Epetra_Vector.h

Go to the documentation of this file.
00001 
00002 //@HEADER
00003 /*
00004 ************************************************************************
00005 
00006               Epetra: Linear Algebra Services Package 
00007                 Copyright (2001) Sandia Corporation
00008 
00009 Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00010 license for use of this work by or on behalf of the U.S. Government.
00011 
00012 This library is free software; you can redistribute it and/or modify
00013 it under the terms of the GNU Lesser General Public License as
00014 published by the Free Software Foundation; either version 2.1 of the
00015 License, or (at your option) any later version.
00016  
00017 This library is distributed in the hope that it will be useful, but
00018 WITHOUT ANY WARRANTY; without even the implied warranty of
00019 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00020 Lesser General Public License for more details.
00021  
00022 You should have received a copy of the GNU Lesser General Public
00023 License along with this library; if not, write to the Free Software
00024 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00025 USA
00026 Questions? Contact Michael A. Heroux (maherou@sandia.gov) 
00027 
00028 ************************************************************************
00029 */
00030 //@HEADER
00031 
00032 #ifndef EPETRA_VECTOR_H
00033 #define EPETRA_VECTOR_H
00034 
00035 #include "Epetra_MultiVector.h"
00036 class Epetra_Map;
00037 
00039 
00128 //=========================================================================
00129 class Epetra_Vector : public Epetra_MultiVector {
00130 
00131   public:
00132 
00134 
00135 
00136 
00152   Epetra_Vector(const Epetra_BlockMap& Map, bool zeroOut = true);
00153 
00155   
00156   Epetra_Vector(const Epetra_Vector& Source);
00157   
00159 
00171   Epetra_Vector(Epetra_DataAccess CV, const Epetra_BlockMap& Map, double *V);
00172 
00174 
00188   Epetra_Vector(Epetra_DataAccess CV, const Epetra_MultiVector& Source, int Index);
00189 
00191     virtual ~Epetra_Vector ();
00193   
00195 
00196 
00198 
00211   int ReplaceGlobalValues(int NumEntries, double * Values, int * Indices);
00212 
00214 
00227   int ReplaceMyValues(int NumEntries, double * Values, int * Indices);
00228 
00230 
00243   int SumIntoGlobalValues(int NumEntries, double * Values, int * Indices);
00244 
00246 
00259   int SumIntoMyValues(int NumEntries, double * Values, int * Indices);
00260 
00261   // Blockmap Versions
00262 
00264 
00282   int ReplaceGlobalValues(int NumEntries, int BlockOffset, double * Values, int * Indices);
00283 
00285 
00303   int ReplaceMyValues(int NumEntries, int BlockOffset, double * Values, int * Indices);
00304 
00306 
00324   int SumIntoGlobalValues(int NumEntries, int BlockOffset, double * Values, int * Indices);
00325 
00327 
00345   int SumIntoMyValues(int NumEntries, int BlockOffset, double * Values, int * Indices);
00347 
00349 
00350 
00351   //Let the compiler know we intend to overload the base-class ExtractCopy
00352   //function, rather than hide it.
00353   using Epetra_MultiVector::ExtractCopy;
00354 
00356 
00362   int ExtractCopy(double *V) const;
00363   
00364   //Let the compiler know we intend to overload the base-class ExtractView
00365   //function, rather than hide it.
00366   using Epetra_MultiVector::ExtractView;
00367 
00369 
00375   int ExtractView(double **V) const;
00377 
00379 
00380 
00382 
00385     double& operator [] (int index)
00386     {
00387 #ifdef HAVE_EPETRA_ARRAY_BOUNDS_CHECK
00388       EPETRA_TEST_FOR_EXCEPTION(
00389         !( 0 <= index && index < this->MyLength() ), -99,
00390         "Epetra_Vector::operator[](int): "
00391         "The index = " << index << " does not fall in the range"
00392         "[0,"<<this->MyLength()<<")"
00393         );
00394 #endif
00395       return Values_[index];
00396     }
00398 
00401     const double& operator [] (int index) const
00402     {
00403 #ifdef HAVE_EPETRA_ARRAY_BOUNDS_CHECK
00404       EPETRA_TEST_FOR_EXCEPTION(
00405         !( 0 <= index && index < this->MyLength() ), -99,
00406         "Epetra_Vector::operator[](int) const: "
00407         "The index = " << index << " does not fall in the range"
00408         "[0,"<<this->MyLength()<<")"
00409         );
00410 #endif
00411       return Values_[index];
00412     }
00414     
00416 
00417 
00418   //Let the compiler know we intend to overload the base-class ResetView
00419   //function, rather than hide it.
00420   using Epetra_MultiVector::ResetView;
00421 
00423 
00442   int ResetView(double * Values_in) {EPETRA_CHK_ERR(Epetra_MultiVector::ResetView(&Values_in)); return(0);};
00444  private:
00445 
00446     int ChangeValues(int NumEntries, int BlockOffset, double * Values, int * Indices, bool IndicesGlobal, bool SumInto);
00447 
00448 };
00449 
00450 #endif /* EPETRA_VECTOR_H */

Generated on Wed May 12 21:41:05 2010 for Epetra Package Browser (Single Doxygen Collection) by  doxygen 1.4.7