Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Vector_n Class Reference

#include <Vector_n.h>

Inheritance diagram for Vector_n:
Collaboration diagram for Vector_n:

Public Types

typedef Vector_n Self
 
typedef Array_n Base
 
typedef Real Value
 
typedef RealPointer
 
typedef Real const * Const_pointer
 
typedef RealReference
 
typedef const RealConst_reference
 
typedef unsigned int Size
 
- Public Types inherited from Array_n
typedef Array_n Self
 
typedef Real Value
 
typedef RealPointer
 
typedef Real const * Const_pointer
 
typedef RealReference
 
typedef const RealConst_reference
 
typedef unsigned int Size
 

Public Member Functions

 Vector_n ()
 
 Vector_n (Size n)
 
 Vector_n (Size n, Real x)
 
 Vector_n (const Vector_n &v)
 
 operator const Array_n_const & () const
 
Selfoperator= (const Array_n_const &v)
 
Selfoperator+= (const Array_n_const &v)
 
Selfoperator-= (const Array_n_const &v)
 
Selfoperator*= (Real t)
 
Selfoperator*= (const Array_n_const &v1)
 
Selfoperator/= (Real t)
 
Selfoperator/= (const Array_n_const &v)
 
Selfinvert ()
 
- Public Member Functions inherited from Array_n
 Array_n ()
 
 Array_n (Real *v, Size n)
 
 Array_n (Real *v1, Real *v2)
 
 Array_n (const Self &v)
 
 operator const Array_n_const & () const
 
Reference operator[] (Size i)
 
Const_reference operator[] (Size i) const
 
Size dimension () const
 
Const_pointer begin () const
 
Const_pointer end () const
 
Pointer begin ()
 
Pointer end ()
 
Real squared_norm () const
 
Selfoperator= (const Array_n_const &v)
 
Selfoperator= (const Self &v)
 
Selfoperator= (const Vector_n &v)
 
Selfoperator+= (const Array_n_const &v1)
 
Selfoperator-= (const Array_n_const &v1)
 
Selfoperator*= (Real t)
 
Selfoperator*= (const Array_n_const &v1)
 
Selfoperator/= (Real t)
 
Selfoperator/= (const Array_n_const &v1)
 
Selfinvert ()
 

Protected Types

enum  { MAX =9 }
 

Protected Member Functions

 Vector_n (const Array_n_const &v)
 

Protected Attributes

Real _values [MAX]
 
- Protected Attributes inherited from Array_n
Real_start
 
Real_end
 

Friends

Vector_n operator+ (const Array_n_const &v1, const Array_n_const &v2)
 
Vector_n operator- (const Array_n_const &v1, const Array_n_const &v2)
 
Vector_n operator* (Real a, const Array_n_const &v1)
 
Vector_n operator* (const Array_n_const &v1, Real a)
 
Vector_n operator/ (const Array_n_const &v1, Real a)
 
Vector_n multiply (const Array_n_const &v1, const Array_n_const &v2)
 
Vector_n divide (const Array_n_const &v1, const Array_n_const &v2)
 
Vector_n min (const Array_n_const &v1, const Array_n_const &v2)
 
Vector_n max (const Array_n_const &v1, const Array_n_const &v2)
 

Detailed Description

Definition at line 184 of file Vector_n.h.

Member Typedef Documentation

typedef Array_n Base

Definition at line 187 of file Vector_n.h.

typedef Real const* Const_pointer

Definition at line 190 of file Vector_n.h.

typedef const Real& Const_reference

Definition at line 192 of file Vector_n.h.

typedef Real* Pointer

Definition at line 189 of file Vector_n.h.

typedef Real& Reference

Definition at line 191 of file Vector_n.h.

typedef Vector_n Self

Definition at line 186 of file Vector_n.h.

typedef unsigned int Size

Definition at line 193 of file Vector_n.h.

typedef Real Value

Definition at line 188 of file Vector_n.h.

Member Enumeration Documentation

anonymous enum
protected
Enumerator
MAX 

Definition at line 259 of file Vector_n.h.

259 { MAX=9};

Constructor & Destructor Documentation

Vector_n ( )
inline

Definition at line 205 of file Vector_n.h.

205 {}
Vector_n ( Size  n)
inlineexplicit

Definition at line 206 of file Vector_n.h.

References MAX, and RFC_assertion.

206 : Base( _values, n) { RFC_assertion( n<=MAX); }
Array_n Base
Definition: Vector_n.h:187
const NT & n
Real _values[MAX]
Definition: Vector_n.h:260
#define RFC_assertion
Definition: rfc_basic.h:65
Vector_n ( Size  n,
Real  x 
)
inlineexplicit

Definition at line 207 of file Vector_n.h.

References Array_n::_end, Array_n::_start, MAX, and RFC_assertion.

207  : Base( _values, n)
208  { RFC_assertion(n<=MAX); std::fill( _start, _end, x); }
Real * _end
Definition: Vector_n.h:181
Array_n Base
Definition: Vector_n.h:187
void int int REAL * x
Definition: read.cpp:74
const NT & n
Real * _start
Definition: Vector_n.h:181
Real _values[MAX]
Definition: Vector_n.h:260
#define RFC_assertion
Definition: rfc_basic.h:65
Vector_n ( const Vector_n v)
inline

Definition at line 209 of file Vector_n.h.

References Array_n::_end, Array_n::_start, _values, copy, Array_n::dimension(), MAX, and RFC_assertion.

209  : Base( _values, v.dimension())
Real * _end
Definition: Vector_n.h:181
Size dimension() const
Definition: Vector_n.h:119
Array_n Base
Definition: Vector_n.h:187
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to ** copy
Definition: roccomf90.h:20
Real * _start
Definition: Vector_n.h:181
Real _values[MAX]
Definition: Vector_n.h:260
#define RFC_assertion
Definition: rfc_basic.h:65

Here is the call graph for this function:

Vector_n ( const Array_n_const v)
inlineprotected

Definition at line 261 of file Vector_n.h.

References Array_n_const::_end, Array_n_const::_start, _values, copy, Array_n_const::dimension(), MAX, and RFC_assertion.

261  : Base( _values, v.dimension()) {
262  RFC_assertion( v.dimension() <= MAX);
264  }
Size dimension() const
Definition: Vector_n.h:79
const Real * _start
Definition: Vector_n.h:91
Array_n Base
Definition: Vector_n.h:187
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to ** copy
Definition: roccomf90.h:20
const Real * _end
Definition: Vector_n.h:91
Real _values[MAX]
Definition: Vector_n.h:260
#define RFC_assertion
Definition: rfc_basic.h:65

Here is the call graph for this function:

Member Function Documentation

Self& invert ( )
inline

Definition at line 253 of file Vector_n.h.

References Array_n::invert().

253  {
254  Base::invert();
255  return *this;
256  }
Self & invert()
Definition: Vector_n.h:175

Here is the call graph for this function:

operator const Array_n_const & ( ) const
inline

Definition at line 212 of file Vector_n.h.

212  {
213  return reinterpret_cast<const Base&>(*this);
214  }
Array_n Base
Definition: Vector_n.h:187
Self& operator*= ( Real  t)
inline

Definition at line 231 of file Vector_n.h.

References Array_n::operator*=().

231  {
232  Base::operator*=( t);
233  return *this;
234  }
Self & operator*=(Real t)
Definition: Vector_n.h:152

Here is the call graph for this function:

Self& operator*= ( const Array_n_const v1)
inline

Definition at line 236 of file Vector_n.h.

References Array_n_const::_end, Array_n::_end, Array_n_const::_start, Array_n::_start, q, and RFC_assertion.

236  {
237  RFC_assertion( _end-_start == v1._end-v1._start);
238  const Real *q=v1._start;
239  for ( Real *p=_start; p!=_end; ++p, ++q) *p *= *q;
240  return *this;
241  }
Real * _end
Definition: Vector_n.h:181
const Real * _start
Definition: Vector_n.h:91
double Real
Definition: mapbasic.h:322
const Real * _end
Definition: Vector_n.h:91
Real * _start
Definition: Vector_n.h:181
NT q
#define RFC_assertion
Definition: rfc_basic.h:65
Self& operator+= ( const Array_n_const v)
inline

Definition at line 221 of file Vector_n.h.

References Array_n::operator+=().

221  {
222  Base::operator+=( v);
223  return *this;
224  }
Self & operator+=(const Array_n_const &v1)
Definition: Vector_n.h:138

Here is the call graph for this function:

Self& operator-= ( const Array_n_const v)
inline

Definition at line 226 of file Vector_n.h.

References Array_n::operator-=().

226  {
227  Base::operator-=( v);
228  return *this;
229  }
Self & operator-=(const Array_n_const &v1)
Definition: Vector_n.h:145

Here is the call graph for this function:

Self& operator/= ( Real  t)
inline

Definition at line 243 of file Vector_n.h.

References Array_n::operator/=().

243  {
244  Base::operator/=( t);
245  return *this;
246  }
Self & operator/=(Real t)
Definition: Vector_n.h:163

Here is the call graph for this function:

Self& operator/= ( const Array_n_const v)
inline

Definition at line 248 of file Vector_n.h.

References Array_n::operator/=().

248  {
249  Base::operator/=( v);
250  return *this;
251  }
Self & operator/=(Real t)
Definition: Vector_n.h:163

Here is the call graph for this function:

Self& operator= ( const Array_n_const v)
inline

Definition at line 216 of file Vector_n.h.

References Array_n::operator=().

216  {
217  Base::operator=( v);
218  return *this;
219  }
Self & operator=(const Array_n_const &v)
Definition: Vector_n.h:128

Here is the call graph for this function:

Friends And Related Function Documentation

Vector_n divide ( const Array_n_const v1,
const Array_n_const v2 
)
friend

Definition at line 338 of file Vector_n.h.

338  {
339  RFC_assertion( v1._end-v1._start == v2._end-v2._start);
340  Vector_n v3( v1._end-v1._start);
341  const Real *p=v1._start, *q=v2._start;
342  for ( Real *r=v3._start; p!=v1._end; ++p, ++q, ++r) *r = (*q==0)? 1. : *p / *q;
343  return v3;
344 }
const Real * _start
Definition: Vector_n.h:91
double Real
Definition: mapbasic.h:322
const Real * _end
Definition: Vector_n.h:91
NT q
#define RFC_assertion
Definition: rfc_basic.h:65
Vector_n max ( const Array_n_const v1,
const Array_n_const v2 
)
friend

Definition at line 354 of file Vector_n.h.

354  {
355  RFC_assertion( v1._end-v1._start == v2._end-v2._start);
356  Vector_n v3( v1._end-v1._start);
357  const Real *p=v1._start, *q=v2._start;
358  for ( Real *r=v3._start; p!=v1._end; ++p, ++q, ++r) *r = std::max(*p,*q);
359  return v3;
360 }
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:354
const Real * _start
Definition: Vector_n.h:91
double Real
Definition: mapbasic.h:322
const Real * _end
Definition: Vector_n.h:91
NT q
#define RFC_assertion
Definition: rfc_basic.h:65
Vector_n min ( const Array_n_const v1,
const Array_n_const v2 
)
friend

Definition at line 346 of file Vector_n.h.

346  {
347  RFC_assertion( v1._end-v1._start == v2._end-v2._start);
348  Vector_n v3( v1._end-v1._start);
349  const Real *p=v1._start, *q=v2._start;
350  for ( Real *r=v3._start; p!=v1._end; ++p, ++q, ++r) *r = std::min(*p,*q);
351  return v3;
352 }
const Real * _start
Definition: Vector_n.h:91
double Real
Definition: mapbasic.h:322
const Real * _end
Definition: Vector_n.h:91
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:346
NT q
#define RFC_assertion
Definition: rfc_basic.h:65
Vector_n multiply ( const Array_n_const v1,
const Array_n_const v2 
)
friend

Definition at line 330 of file Vector_n.h.

330  {
331  RFC_assertion( v1._end-v1._start == v2._end-v2._start);
332  Vector_n v3( v1._end-v1._start);
333  const Real *p=v1._start, *q=v2._start;
334  for ( Real *r=v3._start; p!=v1._end; ++p, ++q, ++r) *r = *p * *q;
335  return v3;
336 }
const Real * _start
Definition: Vector_n.h:91
double Real
Definition: mapbasic.h:322
const Real * _end
Definition: Vector_n.h:91
NT q
#define RFC_assertion
Definition: rfc_basic.h:65
Vector_n operator* ( Real  a,
const Array_n_const v1 
)
friend

Definition at line 309 of file Vector_n.h.

309  {
310  Vector_n v2( v1._end-v1._start);
311  const Real *p=v1._start;
312  for ( Real *q=v2._start; p!=v1._end; ++p, ++q) *q = a * *p;
313  return v2;
314 }
const Real * _start
Definition: Vector_n.h:91
double Real
Definition: mapbasic.h:322
const Real * _end
Definition: Vector_n.h:91
NT q
Vector_n operator* ( const Array_n_const v1,
Real  a 
)
friend

Definition at line 316 of file Vector_n.h.

316  {
317  Vector_n v2( v1._end-v1._start);
318  const Real *p=v1._start;
319  for ( Real *q=v2._start; p!=v1._end; ++p, ++q) *q = a * *p;
320  return v2;
321 }
const Real * _start
Definition: Vector_n.h:91
double Real
Definition: mapbasic.h:322
const Real * _end
Definition: Vector_n.h:91
NT q
Vector_n operator+ ( const Array_n_const v1,
const Array_n_const v2 
)
friend

Definition at line 282 of file Vector_n.h.

282  {
283  RFC_assertion( v1._end-v1._start == v2._end-v2._start);
284  Vector_n v3( v1._end-v1._start);
285  const Real *p=v1._start, *q=v2._start;
286  for ( Real *r=v3._start; p!=v1._end; ++p, ++q, ++r) *r = *p + *q;
287  return v3;
288 }
const Real * _start
Definition: Vector_n.h:91
double Real
Definition: mapbasic.h:322
const Real * _end
Definition: Vector_n.h:91
NT q
#define RFC_assertion
Definition: rfc_basic.h:65
Vector_n operator- ( const Array_n_const v1,
const Array_n_const v2 
)
friend

Definition at line 290 of file Vector_n.h.

290  {
291  RFC_assertion( v1._end-v1._start == v2._end-v2._start);
292  Vector_n v3( v1._end-v1._start);
293 
294  const Real *p=v1._start, *q=v2._start;
295  for ( Real *r=v3._start; p!=v1._end; ++p, ++q, ++r)
296  *r = *p - *q;
297  return v3;
298 }
const Real * _start
Definition: Vector_n.h:91
double Real
Definition: mapbasic.h:322
const Real * _end
Definition: Vector_n.h:91
NT q
#define RFC_assertion
Definition: rfc_basic.h:65
Vector_n operator/ ( const Array_n_const v1,
Real  a 
)
friend

Definition at line 323 of file Vector_n.h.

323  {
324  Vector_n v2( v1._end-v1._start);
325  const Real *p=v1._start;
326  for ( Real *q=v2._start; p!=v1._end; ++p, ++q) *q = (a==0) ? 1.: *p / a;
327  return v2;
328 }
const Real * _start
Definition: Vector_n.h:91
double Real
Definition: mapbasic.h:322
const Real * _end
Definition: Vector_n.h:91
NT q

Member Data Documentation

Real _values[MAX]
protected

Definition at line 260 of file Vector_n.h.

Referenced by Vector_n().


The documentation for this class was generated from the following file: