10 #ifndef _TEUCHOS_SERIALDENSEVECTOR_HPP_
11 #define _TEUCHOS_SERIALDENSEVECTOR_HPP_
26 template<
typename OrdinalType,
typename ScalarType>
79 int size(OrdinalType length_in)
147 const ScalarType&
operator () (OrdinalType index)
const;
161 const ScalarType&
operator [] (OrdinalType index)
const;
173 OrdinalType
length()
const {
return(this->numRows_);}
179 std::ostream&
print(std::ostream& os)
const;
184 template<
typename OrdinalType,
typename ScalarType>
187 template<
typename OrdinalType,
typename ScalarType>
190 template<
typename OrdinalType,
typename ScalarType>
192 SerialDenseMatrix<OrdinalType,ScalarType>( CV, values_in, length_in, length_in, 1 ) {}
194 template<
typename OrdinalType,
typename ScalarType>
198 template<
typename OrdinalType,
typename ScalarType>
202 template<
typename OrdinalType,
typename ScalarType>
205 template<
typename OrdinalType,
typename ScalarType>
212 template<
typename OrdinalType,
typename ScalarType>
216 if(this->numRows_ != Operand.numRows_)
223 for(i = 0; i < this->numRows_; i++) {
224 if((*
this)(i) != Operand(i))
233 template<
typename OrdinalType,
typename ScalarType>
236 return !((*this)==Operand);
239 template<
typename OrdinalType,
typename ScalarType>
243 "SerialDenseVector<T>::dot : " <<
244 "Number of rows " << this->numRows_ <<
" not equal to x.numRows_ "<< x.
numRows() );
250 template<
typename OrdinalType,
typename ScalarType>
254 if(this->valuesCopied_)
255 os <<
"Values_copied : yes" << std::endl;
257 os <<
"Values_copied : no" << std::endl;
258 os <<
"Length : " << this->numRows_ << std::endl;
259 if(this->numRows_ == 0) {
260 os <<
"(std::vector is empty, no values to display)" << std::endl;
262 for(OrdinalType i = 0; i < this->numRows_; i++) {
263 os << (*this)(i) <<
" ";
274 template<
typename OrdinalType,
typename ScalarType>
277 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK
278 this->checkIndex( index );
280 return(this->values_[index]);
283 template<
typename OrdinalType,
typename ScalarType>
286 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK
287 this->checkIndex( index );
289 return(this->values_[index]);
292 template<
typename OrdinalType,
typename ScalarType>
295 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK
296 this->checkIndex( index );
298 return(this->values_[index]);
301 template<
typename OrdinalType,
typename ScalarType>
304 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK
305 this->checkIndex( index );
307 return(this->values_[index]);
311 template<
typename OrdinalType,
typename ScalarType>
321 template<
typename OrdinalType,
typename ScalarType>
323 operator<<(std::ostream &out,
326 printer.obj.print(out);
331 template<
typename OrdinalType,
typename ScalarType>
332 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.
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...