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 virtual void 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) <<
" ";
306 template<
typename OrdinalType,
typename ScalarType>
309 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK
310 this->checkIndex( index );
312 return(this->values_[index]);
315 template<
typename OrdinalType,
typename ScalarType>
318 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK
319 this->checkIndex( index );
321 return(this->values_[index]);
324 template<
typename OrdinalType,
typename ScalarType>
327 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK
328 this->checkIndex( index );
330 return(this->values_[index]);
333 template<
typename OrdinalType,
typename ScalarType>
336 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK
337 this->checkIndex( index );
339 return(this->values_[index]);
ScalarType * values() const
Data array access method.
virtual void print(std::ostream &os) const
Print method. Define the behavior of the std::ostream << operator inherited from the Object class...
ScalarType & operator[](OrdinalType index)
Element access method (non-const).
Templated serial dense matrix class.
ScalarType dot(const SerialDenseVector< OrdinalType, ScalarType > &x) const
Compute the dot product of this vector and x.
#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.
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.
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).
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...