43 #ifndef _TEUCHOS_SERIALDENSEVECTOR_HPP_
44 #define _TEUCHOS_SERIALDENSEVECTOR_HPP_
59 template<
typename OrdinalType,
typename ScalarType>
112 int size(OrdinalType length_in)
180 const ScalarType&
operator () (OrdinalType index)
const;
194 const ScalarType&
operator [] (OrdinalType index)
const;
212 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>
249 if(this->numRows_ != Operand.
numRows_)
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>
287 if(this->valuesCopied_)
288 os <<
"Values_copied : yes" << std::endl;
290 os <<
"Values_copied : no" << std::endl;
291 os <<
"Length : " << this->numRows_ << std::endl;
292 if(this->numRows_ == 0) {
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
311 this->checkIndex( index );
313 return(this->values_[index]);
316 template<
typename OrdinalType,
typename ScalarType>
319 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK
320 this->checkIndex( index );
322 return(this->values_[index]);
325 template<
typename OrdinalType,
typename ScalarType>
328 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK
329 this->checkIndex( index );
331 return(this->values_[index]);
334 template<
typename OrdinalType,
typename ScalarType>
337 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK
338 this->checkIndex( index );
340 return(this->values_[index]);
344 template<
typename OrdinalType,
typename ScalarType>
354 template<
typename OrdinalType,
typename ScalarType>
359 printer.
obj.print(out);
364 template<
typename OrdinalType,
typename ScalarType>
365 SerialDenseVectorPrinter<OrdinalType,ScalarType>
ScalarType * values() const
Data array access method.
ScalarType & operator[](OrdinalType index)
Element access method (non-const).
Templated serial dense matrix class.
SerialBandDenseMatrixPrinter< OrdinalType, ScalarType > printMat(const SerialBandDenseMatrix< OrdinalType, ScalarType > &obj)
Return SerialBandDenseMatrix ostream manipulator Use as:
ScalarType dot(const SerialDenseVector< OrdinalType, ScalarType > &x) const
Compute the dot product of this vector and x.
std::ostream & print(std::ostream &os) const
Print method. Define the behavior of the std::ostream << operator inherited from the Object class...
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Macro for throwing an exception with breakpointing to ease debugging.
Teuchos header file which uses auto-configuration information to include necessary C++ headers...
int resize(OrdinalType length_in)
Resizing method for changing the size of a SerialDenseVector, keeping the entries.
This class creates and provides basic support for dense vectors of templated type as a specialization...
SerialDenseVector()
Default Constructor.
SerialDenseMatrix< OrdinalType, ScalarType > & operator=(const SerialDenseMatrix< OrdinalType, ScalarType > &Source)
Copies values from one matrix to another.
bool operator==(const SerialDenseVector< OrdinalType, ScalarType > &Operand) const
Equality of two matrices.
const SerialDenseVector< OrdinalType, ScalarType > & obj
std::ostream & operator<<(std::ostream &os, BigUInt< n > a)
int putScalar(const ScalarType value=Teuchos::ScalarTraits< ScalarType >::zero())
Set all values in the matrix to a constant value.
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.
OrdinalType length() const
Returns the length of this vector.
Ostream manipulator for SerialDenseVector.
SerialDenseVector< OrdinalType, ScalarType > & operator=(const ScalarType value)
Set all values in the matrix to a constant value.
int size(OrdinalType length_in)
Size method for changing the size of a SerialDenseVector, initializing entries to zero...
ScalarType & operator()(OrdinalType index)
Element access method (non-const).
SerialDenseVectorPrinter(const SerialDenseVector< OrdinalType, ScalarType > &obj_in)
virtual ~SerialDenseVector()
Destructor.
bool operator!=(const SerialDenseVector< OrdinalType, ScalarType > &Operand) const
Inequality of two matrices.
OrdinalType numRows() const
Returns the row dimension of this matrix.
int sizeUninitialized(OrdinalType length_in)
Same as size() except leaves values uninitialized.
This class creates and provides basic support for dense rectangular matrix of templated type...