Teuchos Package Browser (Single Doxygen Collection)
Version of the Day
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
numerics
example
BLAS
numerics/example/BLAS/cxx_main.cpp
Go to the documentation of this file.
1
// @HEADER
2
// *****************************************************************************
3
// Teuchos: Common Tools Package
4
//
5
// Copyright 2004 NTESS and the Teuchos contributors.
6
// SPDX-License-Identifier: BSD-3-Clause
7
// *****************************************************************************
8
// @HEADER
9
10
#include "
Teuchos_BLAS.hpp
"
11
#include "
Teuchos_Version.hpp
"
12
13
int
main
(
int
argc,
char
* argv[])
14
{
15
std::cout <<
Teuchos::Teuchos_Version
() << std::endl << std::endl;
16
17
// Creating an instance of the BLAS class for double-precision kernels looks like:
18
Teuchos::BLAS<int, double>
blas;
19
20
// This instance provides the access to all the BLAS kernels listed in Figure \ref{blas_kernels}:
21
const
int
n
= 10;
22
double
alpha = 2.0;
23
double
x[
n
];
24
for
(
int
i=0; i<
n
; i++ ) { x[i] = i; }
25
blas.
SCAL
( n, alpha, x, 1 );
26
int
max_idx = blas.
IAMAX
( n, x, 1 );
27
std::cout<<
"The index of the maximum magnitude entry of x[] is the "
28
<< max_idx <<
"-th and x[ "
<< max_idx-1 <<
" ] = "
<< x[max_idx-1]
29
<< std::endl;
30
31
return
0;
32
}
Teuchos_BLAS.hpp
Templated interface class to BLAS routines.
Teuchos::BLAS< int, double >
Definition:
Teuchos_BLAS.hpp:2253
Teuchos::Teuchos_Version
std::string Teuchos_Version()
Definition:
Teuchos_Version.hpp:22
main
int main(int argc, char *argv[])
Definition:
core/example/CommandLineProcessor/cxx_main.cpp:21
Teuchos::BLAS< int, double >::IAMAX
int IAMAX(const int &n, const double *x, const int &incx) const
Definition:
Teuchos_BLAS.cpp:210
Teuchos::BLAS< int, double >::SCAL
void SCAL(const int &n, const double &alpha, double *x, const int &incx) const
Definition:
Teuchos_BLAS.cpp:216
ArrayUnitTestHelpers::n
int n
Definition:
Array_UnitTest_helpers.cpp:13
Teuchos_Version.hpp
Generated on Thu Nov 21 2024 09:21:38 for Teuchos Package Browser (Single Doxygen Collection) by
1.8.5