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;
206 OrdinalType
length()
const {
return(this->numRows_);}
212 #ifndef TEUCHOS_HIDE_DEPRECATED_CODE
214 virtual void print(std::ostream& os)
const;
216 std::ostream&
print(std::ostream& os)
const;
221 template<
typename OrdinalType,
typename ScalarType>
224 template<
typename OrdinalType,
typename ScalarType>
227 template<
typename OrdinalType,
typename ScalarType>
229 SerialDenseMatrix<OrdinalType,ScalarType>( CV, values_in, length_in, length_in, 1 ) {}
231 template<
typename OrdinalType,
typename ScalarType>
235 template<
typename OrdinalType,
typename ScalarType>
239 template<
typename OrdinalType,
typename ScalarType>
242 template<
typename OrdinalType,
typename ScalarType>
249 template<
typename OrdinalType,
typename ScalarType>
253 if(this->numRows_ != Operand.numRows_)
260 for(i = 0; i < this->numRows_; i++) {
261 if((*
this)(i) != Operand(i))
270 template<
typename OrdinalType,
typename ScalarType>
273 return !((*this)==Operand);
276 template<
typename OrdinalType,
typename ScalarType>
280 "SerialDenseVector<T>::dot : " <<
281 "Number of rows " << this->numRows_ <<
" not equal to x.numRows_ "<< x.
numRows() );
287 template<
typename OrdinalType,
typename ScalarType>
288 #ifndef TEUCHOS_HIDE_DEPRECATED_CODE
295 if(this->valuesCopied_)
296 os <<
"Values_copied : yes" << std::endl;
298 os <<
"Values_copied : no" << std::endl;
299 os <<
"Length : " << this->numRows_ << std::endl;
300 if(this->numRows_ == 0) {
301 os <<
"(std::vector is empty, no values to display)" << std::endl;
303 for(OrdinalType i = 0; i < this->numRows_; i++) {
304 os << (*this)(i) <<
" ";
308 #ifdef TEUCHOS_HIDE_DEPRECATED_CODE
317 template<
typename OrdinalType,
typename ScalarType>
320 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK
321 this->checkIndex( index );
323 return(this->values_[index]);
326 template<
typename OrdinalType,
typename ScalarType>
329 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK
330 this->checkIndex( index );
332 return(this->values_[index]);
335 template<
typename OrdinalType,
typename ScalarType>
338 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK
339 this->checkIndex( index );
341 return(this->values_[index]);
344 template<
typename OrdinalType,
typename ScalarType>
347 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK
348 this->checkIndex( index );
350 return(this->values_[index]);
354 template<
typename OrdinalType,
typename ScalarType>
364 template<
typename OrdinalType,
typename ScalarType>
366 operator<<(std::ostream &out,
369 printer.obj.print(out);
374 template<
typename OrdinalType,
typename ScalarType>
375 SerialDenseVectorPrinter<OrdinalType,ScalarType>
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.
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.
#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.
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).
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...