48 using Teuchos::SetScientific;
52 typedef Teuchos::ScalarTraits<ScalarType> STS;
99 <<
"*** ERROR *** DenseMatTraits::GetNumRows or GetNumCols" << endl
100 <<
"Returned incorrect value." << endl;
104 DMT::SyncDeviceToHost(*
dm1);
111 <<
"*** ERROR *** DenseMatTraits::Create(-,-,true)" << endl
112 <<
"Did not initialize to zero!" << endl;
122 <<
"*** ERROR *** DenseMatTraits::Value" << endl
123 <<
"Does not give write access to matrix values!!" << endl;
128 DMT::SyncHostToDevice(*
dm1);
133 DMT::SyncDeviceToHost(*
dm2);
136 <<
"*** ERROR *** DenseMatTraits::PutScalar " << endl
137 <<
"Value at dm2 0,0 is: " << DMT::ValueConst(*
dm2,0,0) << endl;
140 DMT::PutScalar(*
dm2);
141 DMT::SyncDeviceToHost(*
dm2);
142 if( DMT::ValueConst(*
dm2,0,0) !=
zero){
144 <<
"*** ERROR *** DenseMatTraits::" << endl
145 <<
"PutScalar default args failed" << endl;
153 <<
"*** ERROR *** DenseMatTraits::" << endl
154 <<
"Stride failed" << endl;
159 DMT::Randomize(*
dm2);
160 DMT::SyncDeviceToHost(*
dm2);
164 DMT::SyncDeviceToHost(*
dm1);
168 <<
"*** ERROR *** DenseMatTraits::" << endl
169 <<
"Add failed" << endl;
175 DMT::Scale(*
dm1,2.0);
176 DMT::SyncDeviceToHost(*
dm1);
179 <<
"*** ERROR *** DenseMatTraits::" << endl
180 <<
"Assign or scale failed" << endl;
185 DMT::SyncDeviceToHost(*
dm3);
186 if(DMT::ValueConst(*
dm3,0,0) != DMT::ValueConst(*
dm1,1,1)){
188 <<
"*** ERROR *** DenseMatTraits::" << endl
189 <<
"Subview failed" << endl;
195 <<
"*** ERROR *** DenseMatTraits::" << endl
196 <<
"Subview gives wrong dimensions." << endl;
202 if(DMT::ValueConst(*
dm3,0,0) != DMT::ValueConst(*
dm1,1,1) ||
205 <<
"*** ERROR *** DenseMatTraits::" << endl
206 <<
"Subview did not edit value or did not edit original." << endl;
211 if(DMT::ValueConst(*
dm4,0,0) != DMT::ValueConst(*
dm1,2,2)){
213 <<
"*** ERROR *** DenseMatTraits::" << endl
214 <<
"SubviewCopy failed" << endl;
220 <<
"*** ERROR *** DenseMatTraits::" << endl
221 <<
"SubviewCopy gives wrong dimensions." << endl;
226 if(DMT::ValueConst(*
dm4,0,0) == DMT::ValueConst(*
dm1,2,2) ||
229 <<
"*** ERROR *** DenseMatTraits::" << endl
230 <<
"SubviewCopy is incorrect. Possible view but not copy." << endl;
236 if (DMT::ValueConst(*
dm3,0,0) != DMT::ValueConst(*
dm5,0,0) ||
239 <<
"*** ERROR *** DenseMatTraits::" << endl
240 <<
"Subview of a subview is incorrect. Possibly can't take hierarchical subviews." << endl;
254 <<
"*** ERROR *** DenseMatTraits::" << endl
255 <<
"Reshape test 1 gives wrong dimensions." << endl;
263 <<
"*** ERROR *** DenseMatTraits::" << endl
264 <<
"Reshape test 2 gives wrong dimensions." << endl;
272 <<
"*** ERROR *** DenseMatTraits::" << endl
273 <<
"Reshape test 3 gives wrong dimensions." << endl;
278 <<
"*** ERROR *** DenseMatTraits::" << endl
279 <<
"Reshape test 3 does not init to zero." << endl;
284 DMT::SyncDeviceToHost( *
dm2 );
288 <<
"*** ERROR *** DenseMatTraits::" << endl
289 <<
"GetRawHostPtr returns NULL." << endl;
296 <<
"*** ERROR *** DenseMatTraits::" << endl
297 <<
"SubviewConst did not create the right size matrix." << endl;
303 <<
"*** ERROR *** DenseMatTraits::" << endl
304 <<
"GetConstRawHostPtr returns NULL." << endl;
309 DMT::NormFrobenius(*
dm2);