Epetra Package Browser (Single Doxygen Collection)
Development
Toggle main menu visibility
Loading...
Searching...
No Matches
src
Epetra_LongLongVector.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_LONGLONGVECTOR_H
45
#define EPETRA_LONGLONGVECTOR_H
46
47
#include "
Epetra_ConfigDefs.h
"
48
#include "
Epetra_DistObject.h
"
49
#include "
Epetra_BlockMap.h
"
50
#include "
Epetra_Distributor.h
"
51
class
Epetra_Map
;
52
53
#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
54
56
124
125
//=========================================================================
126
class
EPETRA_LIB_DLL_EXPORT
Epetra_LongLongVector
:
public
Epetra_DistObject
{
127
128
public
:
129
131
132
149
Epetra_LongLongVector
(
const
Epetra_BlockMap
&
Map
,
bool
zeroOut =
true
);
150
152
153
Epetra_LongLongVector
(
const
Epetra_LongLongVector
& Source);
154
156
168
Epetra_LongLongVector
(
Epetra_DataAccess
CV,
const
Epetra_BlockMap
&
Map
,
long
long
*V);
169
171
virtual
~Epetra_LongLongVector
();
173
174
176
177
178
int
PutValue
(
long
long
Value);
180
181
183
184
185
187
193
int
ExtractCopy
(
long
long
*V)
const
;
194
196
202
int
ExtractView
(
long
long
**V)
const
;
204
206
207
211
long
long
MaxValue
();
212
214
217
long
long
MinValue
();
218
220
222
223
225
231
Epetra_LongLongVector
& operator = (
const
Epetra_LongLongVector
& Source);
232
234
237
long
long
& operator [] (
int
index) {
return
Values_
[index]; }
239
242
const
long
long
& operator [] (
int
index)
const
{
return
Values_
[index]; }
244
246
247
249
long
long
*
Values
()
const
{
return
(
Values_
);};
250
252
int
MyLength
()
const
{
return
(
Map
().NumMyPoints());};
253
255
long
long
GlobalLength64
()
const
{
return
(
Map
().NumGlobalPoints64());};
257
259
260
262
virtual
void
Print(std::ostream & os)
const
;
264
private
:
265
266
int
AllocateForCopy();
267
int
DoCopy(
long
long
* V);
268
int
AllocateForView();
269
int
DoView(
long
long
* V);
270
271
// Routines to implement Epetra_DistObject virtual methods
272
int
CheckSizes(
const
Epetra_SrcDistObject
& A);
273
274
int
CopyAndPermute(
const
Epetra_SrcDistObject
& Source,
275
int
NumSameIDs,
276
int
NumPermuteIDs,
277
int
* PermuteToLIDs,
278
int
* PermuteFromLIDs,
279
const
Epetra_OffsetIndex
* Indexor,
280
Epetra_CombineMode
CombineMode =
Zero
);
281
282
int
PackAndPrepare(
const
Epetra_SrcDistObject
& Source,
283
int
NumExportIDs,
284
int
* ExportLIDs,
285
int
& LenExports,
286
char
* & Exports,
287
int
& SizeOfPacket,
288
int
* Sizes,
289
bool
& VarSizes,
290
Epetra_Distributor
& Distor);
291
292
int
UnpackAndCombine(
const
Epetra_SrcDistObject
& Source,
293
int
NumImportIDs,
294
int
* ImportLIDs,
295
int
LenImports,
296
char
* Imports,
297
int
& SizeOfPacket,
298
Epetra_Distributor
& Distor,
299
Epetra_CombineMode
CombineMode,
300
const
Epetra_OffsetIndex
* Indexor);
301
302
long
long
*
Values_
;
303
bool
UserAllocated_
;
304
bool
Allocated_
;
305
};
306
307
#endif
// EPETRA_NO_64BIT_GLOBAL_INDICES
308
309
#endif
/* EPETRA_LONGLONGVECTOR_H */
Epetra_BlockMap.h
Epetra_CombineMode
Epetra_CombineMode
Definition
Epetra_CombineMode.h:64
Zero
@ Zero
Definition
Epetra_CombineMode.h:66
Epetra_ConfigDefs.h
Epetra_DataAccess
Epetra_DataAccess
Definition
Epetra_DataAccess.h:55
Epetra_DistObject.h
Epetra_Distributor.h
Epetra_BlockMap
Epetra_BlockMap: A class for partitioning block element vectors and matrices.
Definition
Epetra_BlockMap.h:194
Epetra_DistObject::Map
const Epetra_BlockMap & Map() const
Returns the address of the Epetra_BlockMap for this multi-vector.
Definition
Epetra_DistObject.h:192
Epetra_DistObject::Epetra_DistObject
Epetra_DistObject(const Epetra_BlockMap &Map)
Basic Epetra_DistObject constuctor.
Definition
Epetra_DistObject.cpp:54
Epetra_Distributor
Epetra_Distributor: The Epetra Gather/Scatter Setup Base Class.
Definition
Epetra_Distributor.h:61
Epetra_LongLongVector::PutValue
int PutValue(long long Value)
Set all elements of the vector to Value.
Definition
Epetra_LongLongVector.cpp:162
Epetra_LongLongVector::MyLength
int MyLength() const
Returns the local vector length on the calling processor of vectors in the multi-vector.
Definition
Epetra_LongLongVector.h:252
Epetra_LongLongVector::Values
long long * Values() const
Returns a pointer to an array containing the values of this vector.
Definition
Epetra_LongLongVector.h:249
Epetra_LongLongVector::GlobalLength64
long long GlobalLength64() const
Returns the global vector length of vectors in the multi-vector.
Definition
Epetra_LongLongVector.h:255
Epetra_LongLongVector::ExtractView
int ExtractView(long long **V) const
Set user-provided address of V.
Definition
Epetra_LongLongVector.cpp:155
Epetra_LongLongVector::MinValue
long long MinValue()
Find minimum value.
Definition
Epetra_LongLongVector.cpp:178
Epetra_LongLongVector::UserAllocated_
bool UserAllocated_
Definition
Epetra_LongLongVector.h:303
Epetra_LongLongVector::Values_
long long * Values_
Definition
Epetra_LongLongVector.h:302
Epetra_LongLongVector::Allocated_
bool Allocated_
Definition
Epetra_LongLongVector.h:304
Epetra_LongLongVector::Epetra_LongLongVector
Epetra_LongLongVector(const Epetra_BlockMap &Map, bool zeroOut=true)
Basic Epetra_LongLongVector constuctor.
Definition
Epetra_LongLongVector.cpp:52
Epetra_LongLongVector::MaxValue
long long MaxValue()
Find maximum value.
Definition
Epetra_LongLongVector.cpp:168
Epetra_LongLongVector::ExtractCopy
int ExtractCopy(long long *V) const
Put vector values into user-provided array.
Definition
Epetra_LongLongVector.cpp:147
Epetra_Map
Epetra_Map: A class for partitioning vectors and matrices.
Definition
Epetra_Map.h:119
Epetra_OffsetIndex
Epetra_OffsetIndex: This class builds index for efficient mapping of data from one Epetra_CrsGraph ba...
Definition
Epetra_OffsetIndex.h:60
Epetra_SrcDistObject
Epetra_SrcDistObject: A class for supporting flexible source distributed objects for import/export op...
Definition
Epetra_SrcDistObject.h:63
Generated by
1.18.0