19 lines
522 B
C++
19 lines
522 B
C++
#include "xyz2shc.h"
|
|
|
|
int XYZ2SHC::InitShc(int given_order){
|
|
if (given_order <= 0){
|
|
cerr << BOLDRED << "error ==> " << RESET << "spherical order must be bigger than zero: " << given_order << endl;
|
|
return -1;
|
|
}
|
|
else{
|
|
shc_order_ = given_order;
|
|
shc_num_ = (shc_order_+1)*(shc_order_+2);
|
|
half_shc_num_ = (shc_order_+1)*(shc_order_+2)/2;
|
|
//初始化shc_value_
|
|
shc_value_.resize(shc_num_,0.0);
|
|
//初始化Anm_和Bnm_
|
|
Anm_ = get_Anm_array(shc_order_+1);
|
|
Bnm_ = get_Bnm_array(shc_order_+1);
|
|
return 0;
|
|
}
|
|
} |