Epetra Package Browser (Single Doxygen Collection)
Development
Toggle main menu visibility
Loading...
Searching...
No Matches
src
Epetra_LongLongSerialDenseVector.h
Go to the documentation of this file.
1
/*
2
//@HEADER
3
// ************************************************************************
4
//
5
// Epetra: Linear Algebra Services Package
6
// Copyright 2011 Sandia Corporation
7
//
8
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9
// the U.S. Government retains certain rights in this software.
10
//
11
// Redistribution and use in source and binary forms, with or without
12
// modification, are permitted provided that the following conditions are
13
// met:
14
//
15
// 1. Redistributions of source code must retain the above copyright
16
// notice, this list of conditions and the following disclaimer.
17
//
18
// 2. Redistributions in binary form must reproduce the above copyright
19
// notice, this list of conditions and the following disclaimer in the
20
// documentation and/or other materials provided with the distribution.
21
//
22
// 3. Neither the name of the Corporation nor the names of the
23
// contributors may be used to endorse or promote products derived from
24
// this software without specific prior written permission.
25
//
26
// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37
//
38
// Questions? Contact Michael A. Heroux (maherou@sandia.gov)
39
//
40
// ************************************************************************
41
//@HEADER
42
*/
43
44
#ifndef EPETRA_LONGLONGSERIALDENSEVECTOR_H
45
#define EPETRA_LONGLONGSERIALDENSEVECTOR_H
46
47
#include "
Epetra_ConfigDefs.h
"
48
#include "
Epetra_Object.h
"
49
#include "
Epetra_LongLongSerialDenseMatrix.h
"
50
51
#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
52
54
87
88
89
//=========================================================================
90
class
EPETRA_LIB_DLL_EXPORT
Epetra_LongLongSerialDenseVector
:
public
Epetra_LongLongSerialDenseMatrix
{
91
92
public
:
93
95
100
Epetra_LongLongSerialDenseVector
();
101
103
112
Epetra_LongLongSerialDenseVector
(
int
Length_in);
113
115
125
Epetra_LongLongSerialDenseVector
(
Epetra_DataAccess
CV_in,
long
long
* Values_in,
int
Length_in);
126
128
129
Epetra_LongLongSerialDenseVector
(
const
Epetra_LongLongSerialDenseVector
& Source);
130
132
142
int
Size
(
int
Length_in) {
return
(
Epetra_LongLongSerialDenseMatrix::Shape
(Length_in, 1));};
143
145
156
int
Resize
(
int
Length_in) {
return
(
Epetra_LongLongSerialDenseMatrix::Reshape
(Length_in, 1));};
157
159
virtual
~Epetra_LongLongSerialDenseVector
();
160
161
//bring the base-class operator() into the current scope, in order to tell the
162
//compiler that we intend to overload it, rather than hide it.
163
using
Epetra_LongLongSerialDenseMatrix::operator();
164
166
172
long
long
&
operator ()
(
int
Index);
173
175
181
const
long
long
&
operator ()
(
int
Index)
const
;
182
184
190
long
long
&
operator []
(
int
Index);
191
193
199
const
long
long
&
operator []
(
int
Index)
const
;
200
202
208
int
Random
();
209
211
int
Length
()
const
{
return
(
M_
);};
212
214
long
long
*
Values
() {
return
(
A_
);};
215
217
const
long
long
*
Values
()
const
{
return
(
A_
);};
218
220
Epetra_DataAccess
CV
()
const
{
return
(
CV_
);};
221
223
229
Epetra_LongLongSerialDenseVector
&
operator =
(
const
Epetra_LongLongSerialDenseVector
& Source);
230
232
233
234
virtual
void
Print
(std::ostream& os)
const
;
236
238
239
240
//Bring the base-class MakeViewOf method into the current scope so that the
241
//compiler knows we intend to overload it, rather than hide it.
242
using
Epetra_LongLongSerialDenseMatrix::MakeViewOf
;
243
245
260
261
int
MakeViewOf
(
const
Epetra_LongLongSerialDenseVector
& Source);
263
};
264
265
// inlined definitions of op() and op[]
266
//=========================================================================
267
inline
long
long
&
Epetra_LongLongSerialDenseVector::operator()
(
int
Index) {
268
#ifdef HAVE_EPETRA_ARRAY_BOUNDS_CHECK
269
if
(Index >=
M_
|| Index < 0)
270
throw
ReportError
(
"Index = "
+
toString
(Index) +
271
" Out of Range 0 - "
+
toString
(
M_
-1),-1);
272
#endif
273
return
(
A_
[Index]);
274
}
275
//=========================================================================
276
inline
const
long
long
&
Epetra_LongLongSerialDenseVector::operator()
(
int
Index)
const
{
277
#ifdef HAVE_EPETRA_ARRAY_BOUNDS_CHECK
278
if
(Index >=
M_
|| Index < 0)
279
throw
ReportError
(
"Index = "
+
toString
(Index) +
280
" Out of Range 0 - "
+
toString
(
M_
-1),-1);
281
#endif
282
return
(
A_
[Index]);
283
}
284
//=========================================================================
285
inline
long
long
&
Epetra_LongLongSerialDenseVector::operator []
(
int
Index) {
286
#ifdef HAVE_EPETRA_ARRAY_BOUNDS_CHECK
287
if
(Index >=
M_
|| Index < 0)
288
throw
ReportError
(
"Index = "
+
toString
(Index) +
289
" Out of Range 0 - "
+
toString
(
M_
-1),-1);
290
#endif
291
return
(
A_
[Index]);
292
}
293
//=========================================================================
294
inline
const
long
long
&
Epetra_LongLongSerialDenseVector::operator []
(
int
Index)
const
{
295
#ifdef HAVE_EPETRA_ARRAY_BOUNDS_CHECK
296
if
(Index >=
M_
|| Index < 0)
297
throw
ReportError
(
"Index = "
+
toString
(Index) +
298
" Out of Range 0 - "
+
toString
(
M_
-1),-1);
299
#endif
300
return
(
A_
[Index]);
301
}
302
//=========================================================================
303
304
#endif
// EPETRA_NO_64BIT_GLOBAL_INDICES
305
306
#endif
/* EPETRA_LONGLONGSERIALDENSEVECTOR_H */
Epetra_ConfigDefs.h
Epetra_DataAccess
Epetra_DataAccess
Definition
Epetra_DataAccess.h:55
Epetra_LongLongSerialDenseMatrix.h
Epetra_Object.h
Epetra_LongLongSerialDenseMatrix::Print
virtual void Print(std::ostream &os) const
Print service methods; defines behavior of ostream << operator.
Definition
Epetra_LongLongSerialDenseMatrix.cpp:353
Epetra_LongLongSerialDenseMatrix::Reshape
int Reshape(int NumRows, int NumCols)
Reshape a Epetra_LongLongSerialDenseMatrix object.
Definition
Epetra_LongLongSerialDenseMatrix.cpp:138
Epetra_LongLongSerialDenseMatrix::A_
long long * A_
Definition
Epetra_LongLongSerialDenseMatrix.h:361
Epetra_LongLongSerialDenseMatrix::Random
int Random()
Set matrix values to random numbers.
Definition
Epetra_LongLongSerialDenseMatrix.cpp:377
Epetra_LongLongSerialDenseMatrix::Epetra_LongLongSerialDenseMatrix
Epetra_LongLongSerialDenseMatrix()
Default constructor; defines a zero size object.
Definition
Epetra_LongLongSerialDenseMatrix.cpp:50
Epetra_LongLongSerialDenseMatrix::Shape
int Shape(int NumRows, int NumCols)
Set dimensions of a Epetra_LongLongSerialDenseMatrix object; init values to zero.
Definition
Epetra_LongLongSerialDenseMatrix.cpp:165
Epetra_LongLongSerialDenseMatrix::M_
int M_
Definition
Epetra_LongLongSerialDenseMatrix.h:358
Epetra_LongLongSerialDenseMatrix::CV_
Epetra_DataAccess CV_
Definition
Epetra_LongLongSerialDenseMatrix.h:356
Epetra_LongLongSerialDenseMatrix::MakeViewOf
int MakeViewOf(const Epetra_LongLongSerialDenseMatrix &Source)
Reset an existing LongLongSerialDenseMatrix to point to another Matrix.
Definition
Epetra_LongLongSerialDenseMatrix.cpp:284
Epetra_LongLongSerialDenseMatrix::operator=
Epetra_LongLongSerialDenseMatrix & operator=(const Epetra_LongLongSerialDenseMatrix &Source)
Copy from one matrix to another.
Definition
Epetra_LongLongSerialDenseMatrix.cpp:203
Epetra_LongLongSerialDenseMatrix::operator[]
long long * operator[](int ColIndex)
Column access function.
Definition
Epetra_LongLongSerialDenseMatrix.h:391
Epetra_LongLongSerialDenseMatrix::operator()
long long & operator()(int RowIndex, int ColIndex)
Element access function.
Definition
Epetra_LongLongSerialDenseMatrix.h:367
Epetra_LongLongSerialDenseVector
Epetra_LongLongSerialDenseVector: A class for constructing and using dense vectors.
Definition
Epetra_LongLongSerialDenseVector.h:90
Epetra_LongLongSerialDenseVector::CV
Epetra_DataAccess CV() const
Returns the data access mode of the this vector.
Definition
Epetra_LongLongSerialDenseVector.h:220
Epetra_LongLongSerialDenseVector::Length
int Length() const
Returns length of vector.
Definition
Epetra_LongLongSerialDenseVector.h:211
Epetra_LongLongSerialDenseVector::Size
int Size(int Length_in)
Set length of a Epetra_LongLongSerialDenseVector object; init values to zero.
Definition
Epetra_LongLongSerialDenseVector.h:142
Epetra_LongLongSerialDenseVector::Values
long long * Values()
Returns pointer to the values in vector.
Definition
Epetra_LongLongSerialDenseVector.h:214
Epetra_LongLongSerialDenseVector::Epetra_LongLongSerialDenseVector
Epetra_LongLongSerialDenseVector()
Default constructor; defines a zero size object.
Definition
Epetra_LongLongSerialDenseVector.cpp:49
Epetra_LongLongSerialDenseVector::operator[]
long long & operator[](int Index)
Element access function.
Definition
Epetra_LongLongSerialDenseVector.h:285
Epetra_LongLongSerialDenseVector::Values
const long long * Values() const
Returns const pointer to the values in vector.
Definition
Epetra_LongLongSerialDenseVector.h:217
Epetra_LongLongSerialDenseVector::Resize
int Resize(int Length_in)
Resize a Epetra_LongLongSerialDenseVector object.
Definition
Epetra_LongLongSerialDenseVector.h:156
Epetra_LongLongSerialDenseVector::operator()
long long & operator()(int Index)
Element access function.
Definition
Epetra_LongLongSerialDenseVector.h:267
Epetra_Object::ReportError
virtual int ReportError(const std::string Message, int ErrorCode) const
Error reporting method.
Definition
Epetra_Object.cpp:103
Epetra_Object::toString
std::string toString(const int &x) const
Definition
Epetra_Object.h:145
Generated by
1.17.0