2005-03-30 08:56:34 +08:00
|
|
|
/*BHEADER**********************************************************************
|
2007-11-14 03:16:06 +08:00
|
|
|
* Copyright (c) 2007, Lawrence Livermore National Security, LLC.
|
2006-07-28 07:26:57 +08:00
|
|
|
* Produced at the Lawrence Livermore National Laboratory.
|
2006-09-23 06:06:21 +08:00
|
|
|
* Written by the HYPRE team. UCRL-CODE-222953.
|
2006-07-28 07:26:57 +08:00
|
|
|
* All rights reserved.
|
2005-03-30 08:56:34 +08:00
|
|
|
*
|
2006-07-28 07:26:57 +08:00
|
|
|
* This file is part of HYPRE (see http://www.llnl.gov/CASC/hypre/).
|
|
|
|
|
* Please see the COPYRIGHT_and_LICENSE file for the copyright notice,
|
2006-09-23 06:06:21 +08:00
|
|
|
* disclaimer, contact information and the GNU Lesser General Public License.
|
2006-07-28 07:26:57 +08:00
|
|
|
*
|
2006-09-23 06:06:21 +08:00
|
|
|
* HYPRE is free software; you can redistribute it and/or modify it under the
|
|
|
|
|
* terms of the GNU General Public License (as published by the Free Software
|
|
|
|
|
* Foundation) version 2.1 dated February 1999.
|
2006-07-28 07:26:57 +08:00
|
|
|
*
|
2006-09-23 06:06:21 +08:00
|
|
|
* HYPRE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
|
* WARRANTY; without even the IMPLIED WARRANTY OF MERCHANTABILITY or FITNESS
|
|
|
|
|
* FOR A PARTICULAR PURPOSE. See the terms and conditions of the GNU General
|
|
|
|
|
* Public License for more details.
|
2006-07-28 07:26:57 +08:00
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
|
|
|
|
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
2005-03-30 08:56:34 +08:00
|
|
|
*
|
|
|
|
|
* $Revision$
|
2006-07-28 07:26:57 +08:00
|
|
|
***********************************************************************EHEADER*/
|
|
|
|
|
|
2005-03-30 08:56:34 +08:00
|
|
|
|
2006-09-23 06:06:21 +08:00
|
|
|
|
|
|
|
|
|
2007-11-14 03:16:06 +08:00
|
|
|
|
2005-03-30 08:56:34 +08:00
|
|
|
/******************************************************************************
|
|
|
|
|
*
|
|
|
|
|
* Header info for Multivector data structure
|
|
|
|
|
*
|
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
#ifndef hypre_MULTIVECTOR_HEADER
|
|
|
|
|
#define hypre_MULTIVECTOR_HEADER
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------------
|
|
|
|
|
* hypre_Multivector
|
|
|
|
|
*--------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
|
{
|
|
|
|
|
double *data;
|
|
|
|
|
int size;
|
|
|
|
|
int owns_data;
|
|
|
|
|
int num_vectors; /* the above "size" is size of one vector */
|
|
|
|
|
|
|
|
|
|
int num_active_vectors;
|
|
|
|
|
int *active_indices; /* indices of active vectors; 0-based notation */
|
|
|
|
|
|
|
|
|
|
} hypre_Multivector;
|
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------------
|
|
|
|
|
* Accessor functions for the Multivector structure
|
|
|
|
|
*--------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
#define hypre_MultivectorData(vector) ((vector) -> data)
|
|
|
|
|
#define hypre_MultivectorSize(vector) ((vector) -> size)
|
|
|
|
|
#define hypre_MultivectorOwnsData(vector) ((vector) -> owns_data)
|
|
|
|
|
#define hypre_MultivectorNumVectors(vector) ((vector) -> num_vectors)
|
|
|
|
|
|
|
|
|
|
hypre_Multivector * hypre_SeqMultivectorCreate(int size, int num_vectors);
|
|
|
|
|
hypre_Multivector *hypre_SeqMultivectorRead(char *file_name);
|
|
|
|
|
|
|
|
|
|
int hypre_SeqMultivectorDestroy(hypre_Multivector *vector);
|
|
|
|
|
int hypre_SeqMultivectorInitialize(hypre_Multivector *vector);
|
|
|
|
|
int hypre_SeqMultivectorSetDataOwner(hypre_Multivector *vector , int owns_data);
|
|
|
|
|
int hypre_SeqMultivectorPrint(hypre_Multivector *vector , char *file_name);
|
|
|
|
|
int hypre_SeqMultivectorSetConstantValues(hypre_Multivector *v,double value);
|
|
|
|
|
int hypre_SeqMultivectorSetRandomValues(hypre_Multivector *v , int seed);
|
|
|
|
|
int hypre_SeqMultivectorCopy(hypre_Multivector *x , hypre_Multivector *y);
|
|
|
|
|
int hypre_SeqMultivectorScale(double alpha , hypre_Multivector *y, int *mask);
|
|
|
|
|
int hypre_SeqMultivectorAxpy(double alpha , hypre_Multivector *x ,
|
|
|
|
|
hypre_Multivector *y);
|
|
|
|
|
int hypre_SeqMultivectorInnerProd(hypre_Multivector *x , hypre_Multivector *y,
|
|
|
|
|
double *results);
|
|
|
|
|
int hypre_SeqMultivectorMultiScale(double *alpha, hypre_Multivector *v,
|
|
|
|
|
int *mask);
|
|
|
|
|
int hypre_SeqMultivectorByDiag(hypre_Multivector *x, int *mask, int n,
|
|
|
|
|
double *alpha, hypre_Multivector *y);
|
|
|
|
|
|
|
|
|
|
int hypre_SeqMultivectorInnerProdDiag(hypre_Multivector *x,
|
|
|
|
|
hypre_Multivector *y,
|
|
|
|
|
double *diagResults );
|
|
|
|
|
|
|
|
|
|
int hypre_SeqMultivectorSetMask(hypre_Multivector *mvector, int * mask);
|
|
|
|
|
|
|
|
|
|
int hypre_SeqMultivectorCopyWithoutMask(hypre_Multivector *x ,
|
|
|
|
|
hypre_Multivector *y);
|
|
|
|
|
|
|
|
|
|
int hypre_SeqMultivectorByMatrix(hypre_Multivector *x, int rGHeight, int rHeight,
|
|
|
|
|
int rWidth, double* rVal, hypre_Multivector *y);
|
|
|
|
|
|
|
|
|
|
int hypre_SeqMultivectorXapy (hypre_Multivector *x, int rGHeight, int rHeight,
|
|
|
|
|
int rWidth, double* rVal, hypre_Multivector *y);
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif /* hypre_MULTIVECTOR_HEADER */
|