WarpTwin
Documentation for WarpTwin models and classes.
Loading...
Searching...
No Matches
InterpolateTrilinear.h
Go to the documentation of this file.
1/******************************************************************************
2* Copyright (c) ATTX INC 2025. All Rights Reserved.
3*
4* This software and associated documentation (the "Software") are the
5* proprietary and confidential information of ATTX, INC. The Software is
6* furnished under a license agreement between ATTX and the user organization
7* and may be used or copied only in accordance with the terms of the agreement.
8* Refer to 'license/attx_license.adoc' for standard license terms.
9*
10* EXPORT CONTROL NOTICE: THIS SOFTWARE MAY INCLUDE CONTENT CONTROLLED UNDER THE
11* INTERNATIONAL TRAFFIC IN ARMS REGULATIONS (ITAR) OR THE EXPORT ADMINISTRATION
12* REGULATIONS (EAR99). No part of the Software may be used, reproduced, or
13* transmitted in any form or by any means, for any purpose, without the express
14* written permission of ATTX, INC.
15******************************************************************************/
16#ifndef UTILS_INTERPOLATE_TRILINEAR_H
17#define UTILS_INTERPOLATE_TRILINEAR_H
18
19#include <vector>
20
22
23namespace warptwin {
84 {
85 public:
100 int setData(const std::vector<double> &valuesA, const std::vector<double> &valuesB, const std::vector<double> &valuesC, const std::vector<double> &valuesD);
101
110 int getMinA(double& minA) const;
111
120 int getMaxA(double& maxA) const;
121
130 int getMinB(double& minB) const;
131
140 int getMaxB(double& maxB) const;
141
150 int getMinC(double& minC) const;
151
160 int getMaxC(double& maxC) const;
161
174 int interpolate(const double &a, const double &b, const double &c, double &interpolated_out);
175
176 private:
177 // coordinate grids
178 std::vector<double> _a_grid;
179 std::vector<double> _b_grid;
180 std::vector<double> _c_grid;
181
182 std::vector<std::vector<std::vector<double>>> _out3d;
183
184 int _Na, _Nb, _Nc = 0;
185
190 int _findIntervalIndex(const std::vector<double> &vec, const double &value) const;
191
197 double _interp(const double &v0, const double &v1, const double &t);
198
204 double _frac(const double &x, const double &x0, const double &x1);
205 };
206}
207
208#endif // UTILS_INTERPOLATE_TRILINEAR_H
A class for performing simple a-b-c-d trilinear interpolation.
Definition InterpolateTrilinear.h:84
int setData(const std::vector< double > &valuesA, const std::vector< double > &valuesB, const std::vector< double > &valuesC, const std::vector< double > &valuesD)
Sets the data for the interpolator.
Definition InterpolateTrilinear.cpp:21
int getMaxC(double &maxC) const
Returns the maximum value from the 3rd column of stored data.
Definition InterpolateTrilinear.cpp:203
int getMaxA(double &maxA) const
Returns the maximum value from the 1st column of stored data.
Definition InterpolateTrilinear.cpp:163
int getMaxB(double &maxB) const
Returns the maximum value from the 2nd column of stored data.
Definition InterpolateTrilinear.cpp:183
int getMinB(double &minB) const
Returns the minimum value from the 2nd column of stored data.
Definition InterpolateTrilinear.cpp:173
int getMinA(double &minA) const
Returns the minimum value from the 1st column of stored data.
Definition InterpolateTrilinear.cpp:153
int getMinC(double &minC) const
Returns the minimum value from the 3rd column of stored data.
Definition InterpolateTrilinear.cpp:193
int interpolate(const double &a, const double &b, const double &c, double &interpolated_out)
Performs trilinear interpolation given an (x, y) value pair.
Definition InterpolateTrilinear.cpp:230
Class to propagate CR3BP dynamics in characteristic units.
Definition statistics.hpp:22