43#ifndef _TEUCHOS_SERIALDENSEVECTOR_HPP_
44#define _TEUCHOS_SERIALDENSEVECTOR_HPP_
59 template<
typename OrdinalType,
typename ScalarType>
112 int size(OrdinalType length_in)
213 std::ostream&
print(std::ostream& os)
const;
217 template<
typename OrdinalType,
typename ScalarType>
220 template<
typename OrdinalType,
typename ScalarType>
223 template<
typename OrdinalType,
typename ScalarType>
225 SerialDenseMatrix<OrdinalType,ScalarType>( CV, values_in, length_in, length_in, 1 ) {}
227 template<
typename OrdinalType,
typename ScalarType>
231 template<
typename OrdinalType,
typename ScalarType>
235 template<
typename OrdinalType,
typename ScalarType>
238 template<
typename OrdinalType,
typename ScalarType>
245 template<
typename OrdinalType,
typename ScalarType>
256 for(i = 0; i < this->
numRows_; i++) {
257 if((*
this)(i) != Operand(i))
266 template<
typename OrdinalType,
typename ScalarType>
269 return !((*this)==Operand);
272 template<
typename OrdinalType,
typename ScalarType>
276 "SerialDenseVector<T>::dot : " <<
277 "Number of rows " << this->numRows_ <<
" not equal to x.numRows_ "<< x.
numRows() );
283 template<
typename OrdinalType,
typename ScalarType>
288 os <<
"Values_copied : yes" << std::endl;
290 os <<
"Values_copied : no" << std::endl;
291 os <<
"Length : " << this->
numRows_ << std::endl;
293 os <<
"(std::vector is empty, no values to display)" << std::endl;
295 for(OrdinalType i = 0; i < this->
numRows_; i++) {
296 os << (*this)(i) <<
" ";
307 template<
typename OrdinalType,
typename ScalarType>
310#ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK
316 template<
typename OrdinalType,
typename ScalarType>
319#ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK
325 template<
typename OrdinalType,
typename ScalarType>
328#ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK
334 template<
typename OrdinalType,
typename ScalarType>
337#ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK
344template<
typename OrdinalType,
typename ScalarType>
354template<
typename OrdinalType,
typename ScalarType>
359 printer.
obj.print(out);
364template<
typename OrdinalType,
typename ScalarType>
365SerialDenseVectorPrinter<OrdinalType,ScalarType>
Teuchos header file which uses auto-configuration information to include necessary C++ headers.
Templated serial dense matrix class.
SerialDenseVector()
Default Constructor.
ScalarType DOT(const OrdinalType &n, const x_type *x, const OrdinalType &incx, const y_type *y, const OrdinalType &incy) const
Form the dot product of the vectors x and y.
int putScalar(const ScalarType value=Teuchos::ScalarTraits< ScalarType >::zero())
Set all values in the matrix to a constant value.
int reshape(OrdinalType numRows, OrdinalType numCols)
Reshaping method for changing the size of a SerialDenseMatrix, keeping the entries.
SerialDenseMatrix< OrdinalType, ScalarType > & operator=(const SerialDenseMatrix< OrdinalType, ScalarType > &Source)
Copies values from one matrix to another.
OrdinalType numRows() const
Returns the row dimension of this matrix.
std::complex< Real > * values() const
int shapeUninitialized(OrdinalType numRows, OrdinalType numCols)
Same as shape() except leaves uninitialized.
SerialDenseMatrix()=default
Default Constructor.
int shape(OrdinalType numRows, OrdinalType numCols)
Shape method for changing the size of a SerialDenseMatrix, initializing entries to zero.
void checkIndex(OrdinalType rowIndex, OrdinalType colIndex=0) const
This class creates and provides basic support for dense vectors of templated type as a specialization...
bool operator==(const SerialDenseVector< OrdinalType, ScalarType > &Operand) const
Equality of two matrices.
bool operator!=(const SerialDenseVector< OrdinalType, ScalarType > &Operand) const
Inequality of two matrices.
SerialDenseVector(OrdinalType length, bool zeroOut=true)
Shaped Constructor.
SerialDenseVector()
Default Constructor.
ScalarType & operator[](OrdinalType index)
Element access method (non-const).
SerialDenseVector(const SerialDenseVector< OrdinalType, ScalarType > &Source)
Copy Constructor.
int resize(OrdinalType length_in)
Resizing method for changing the size of a SerialDenseVector, keeping the entries.
ScalarType dot(const SerialDenseVector< OrdinalType, ScalarType > &x) const
Compute the dot product of this vector and x.
int size(OrdinalType length_in)
Size method for changing the size of a SerialDenseVector, initializing entries to zero.
int sizeUninitialized(OrdinalType length_in)
Same as size() except leaves values uninitialized.
SerialDenseVector(DataAccess CV, ScalarType *values, OrdinalType length)
Shaped Constructor with Values.
SerialDenseVector(DataAccess CV, const SerialDenseVector< OrdinalType, ScalarType > &Source)
Copy Constructor.
ScalarType & operator()(OrdinalType index)
Element access method (non-const).
virtual ~SerialDenseVector()
Destructor.
std::ostream & print(std::ostream &os) const
Print method. Define the behavior of the std::ostream << operator inherited from the Object class.
SerialDenseVector< OrdinalType, ScalarType > & operator=(const ScalarType value)
Set all values in the matrix to a constant value.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Macro for throwing an exception with breakpointing to ease debugging.
std::ostream & operator<<(std::ostream &os, BigUInt< n > a)
SerialBandDenseMatrixPrinter< OrdinalType, ScalarType > printMat(const SerialBandDenseMatrix< OrdinalType, ScalarType > &obj)
Return SerialBandDenseMatrix ostream manipulator Use as:
Ostream manipulator for SerialDenseVector.
SerialDenseVectorPrinter(const SerialDenseVector< OrdinalType, ScalarType > &obj_in)
const SerialDenseVector< OrdinalType, ScalarType > & obj