forked from LLNL/libROM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SVDBasisGenerator.C
39 lines (33 loc) · 1.12 KB
/
SVDBasisGenerator.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/******************************************************************************
*
* Copyright (c) 2013-2019, Lawrence Livermore National Security, LLC
* and other libROM project developers. See the top-level COPYRIGHT
* file for details.
*
* SPDX-License-Identifier: (Apache-2.0 OR MIT)
*
*****************************************************************************/
// Description: The abstract wrapper class for an abstract SVD algorithm and
// sampler. This class provides interfaces to each so that an
// application only needs to instantiate one concrete
// implementation of this class to control all aspects of basis
// vector generation.
#include "SVDBasisGenerator.h"
#include "BasisWriter.h"
namespace CAROM {
SVDBasisGenerator::SVDBasisGenerator(
const std::string& basis_file_name,
Database::formats file_format) :
d_basis_writer(0)
{
if (!basis_file_name.empty()) {
d_basis_writer = new BasisWriter(this, basis_file_name, file_format);
}
}
SVDBasisGenerator::~SVDBasisGenerator()
{
if (d_basis_writer) {
delete d_basis_writer;
}
}
}