source: CIVL/examples/mpi-omp/AMG2013/parcsr_mv/HYPRE_parcsr_vector.c

main
Last change on this file was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5704 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 7.0 KB
Line 
1/*BHEADER**********************************************************************
2 * Copyright (c) 2008, Lawrence Livermore National Security, LLC.
3 * Produced at the Lawrence Livermore National Laboratory.
4 * This file is part of HYPRE. See file COPYRIGHT for details.
5 *
6 * HYPRE is free software; you can redistribute it and/or modify it under the
7 * terms of the GNU Lesser General Public License (as published by the Free
8 * Software Foundation) version 2.1 dated February 1999.
9 *
10 * $Revision: 2.4 $
11 ***********************************************************************EHEADER*/
12
13
14
15/******************************************************************************
16 *
17 * HYPRE_ParVector interface
18 *
19 *****************************************************************************/
20
21#include "headers.h"
22
23/*--------------------------------------------------------------------------
24 * HYPRE_ParVectorCreate
25 *--------------------------------------------------------------------------*/
26
27int
28HYPRE_ParVectorCreate( MPI_Comm comm,
29 HYPRE_BigInt global_size,
30 HYPRE_BigInt *partitioning,
31 HYPRE_ParVector *vector )
32{
33 *vector = (HYPRE_ParVector) hypre_ParVectorCreate(comm, global_size,
34 partitioning) ;
35 if (!vector) hypre_error_in_arg(4);
36
37 return hypre_error_flag;
38}
39
40/*--------------------------------------------------------------------------
41 * HYPRE_ParMultiVectorCreate
42 *--------------------------------------------------------------------------*/
43
44/*int
45HYPRE_ParMultiVectorCreate( MPI_Comm comm,
46 int global_size,
47 int *partitioning,
48 int number_vectors,
49 HYPRE_ParVector *vector )
50{
51 *vector = (HYPRE_ParVector) hypre_ParMultiVectorCreate
52 (comm, global_size, partitioning, number_vectors );
53
54 if (!vector) hypre_error_in_arg(5);
55
56 return hypre_error_flag;
57}*/
58
59/*--------------------------------------------------------------------------
60 * HYPRE_ParVectorDestroy
61 *--------------------------------------------------------------------------*/
62
63int
64HYPRE_ParVectorDestroy( HYPRE_ParVector vector )
65{
66 return ( hypre_ParVectorDestroy( (hypre_ParVector *) vector ) );
67}
68
69/*--------------------------------------------------------------------------
70 * HYPRE_ParVectorInitialize
71 *--------------------------------------------------------------------------*/
72
73int
74HYPRE_ParVectorInitialize( HYPRE_ParVector vector )
75{
76 return ( hypre_ParVectorInitialize( (hypre_ParVector *) vector ) );
77}
78
79/*--------------------------------------------------------------------------
80 * HYPRE_ParVectorRead
81 *--------------------------------------------------------------------------*/
82
83int
84HYPRE_ParVectorRead( MPI_Comm comm,
85 const char *file_name,
86 HYPRE_ParVector *vector)
87{
88 *vector = (HYPRE_ParVector) hypre_ParVectorRead( comm, file_name ) ;
89 if (!vector) hypre_error_in_arg(3);
90 return hypre_error_flag;
91}
92
93/*--------------------------------------------------------------------------
94 * HYPRE_ParVectorPrint
95 *--------------------------------------------------------------------------*/
96
97int
98HYPRE_ParVectorPrint( HYPRE_ParVector vector,
99 const char *file_name )
100{
101 return ( hypre_ParVectorPrint( (hypre_ParVector *) vector,
102 file_name ) );
103}
104
105/*--------------------------------------------------------------------------
106 * HYPRE_ParVectorPrintIJ
107 *--------------------------------------------------------------------------*/
108
109int
110HYPRE_ParVectorPrintIJ( HYPRE_ParVector vector,
111 int base_i, const char *file_name )
112{
113 return ( hypre_ParVectorPrintIJ( (hypre_ParVector *) vector, base_i,
114 file_name ) );
115}
116
117/*--------------------------------------------------------------------------
118 * HYPRE_ParVectorSetConstantValues
119 *--------------------------------------------------------------------------*/
120
121int
122HYPRE_ParVectorSetConstantValues( HYPRE_ParVector vector,
123 double value )
124{
125 return ( hypre_ParVectorSetConstantValues( (hypre_ParVector *) vector,
126 value ) );
127}
128
129/*--------------------------------------------------------------------------
130 * HYPRE_ParVectorSetRandomValues
131 *--------------------------------------------------------------------------*/
132
133int
134HYPRE_ParVectorSetRandomValues( HYPRE_ParVector vector,
135 int seed )
136{
137 return ( hypre_ParVectorSetRandomValues( (hypre_ParVector *) vector,
138 seed ) );
139}
140
141/*--------------------------------------------------------------------------
142 * HYPRE_ParVectorCopy
143 *--------------------------------------------------------------------------*/
144
145int
146HYPRE_ParVectorCopy( HYPRE_ParVector x, HYPRE_ParVector y)
147{
148 return ( hypre_ParVectorCopy( (hypre_ParVector *) x,
149 (hypre_ParVector *) y ) );
150}
151
152/*--------------------------------------------------------------------------
153 * HYPRE_ParVectorCloneShallow
154 *--------------------------------------------------------------------------*/
155
156HYPRE_ParVector
157HYPRE_ParVectorCloneShallow( HYPRE_ParVector x )
158{
159 return ( (HYPRE_ParVector) hypre_ParVectorCloneShallow( (hypre_ParVector *) x ) );
160}
161
162/*--------------------------------------------------------------------------
163 * HYPRE_ParVectorScale
164 *--------------------------------------------------------------------------*/
165
166int
167HYPRE_ParVectorScale( double value, HYPRE_ParVector x)
168{
169 return ( hypre_ParVectorScale( value, (hypre_ParVector *) x) );
170}
171
172/*--------------------------------------------------------------------------
173 * HYPRE_ParVectorAxpy
174 *--------------------------------------------------------------------------*/
175int
176HYPRE_ParVectorAxpy( double alpha,
177 HYPRE_ParVector x,
178 HYPRE_ParVector y )
179{
180 return hypre_ParVectorAxpy( alpha, (hypre_ParVector *)x, (hypre_ParVector *)y );
181}
182
183/*--------------------------------------------------------------------------
184 * HYPRE_ParVectorInnerProd
185 *--------------------------------------------------------------------------*/
186
187int
188HYPRE_ParVectorInnerProd( HYPRE_ParVector x, HYPRE_ParVector y, double *prod)
189{
190 if (!x)
191 {
192 hypre_error_in_arg(1);
193 return hypre_error_flag;
194 }
195
196 if (!y)
197 {
198 hypre_error_in_arg(2);
199 return hypre_error_flag;
200 }
201
202 *prod = hypre_ParVectorInnerProd( (hypre_ParVector *) x,
203 (hypre_ParVector *) y) ;
204 return hypre_error_flag;
205}
206
207/*--------------------------------------------------------------------------
208 * HYPRE_VectorToParVector
209 *--------------------------------------------------------------------------*/
210
211/*int
212HYPRE_VectorToParVector( MPI_Comm comm, HYPRE_Vector b, int *partitioning,
213 HYPRE_ParVector *vector)
214{
215 *vector = (HYPRE_ParVector) hypre_VectorToParVector (comm,
216 (hypre_Vector *) b, partitioning );
217 if (!vector) hypre_error_in_arg(4);
218 return hypre_error_flag;
219}*/
Note: See TracBrowser for help on using the repository browser.