GENIEGenerator
Loading...
Searching...
No Matches
ARWavefunction.cxx
Go to the documentation of this file.
1//____________________________________________________________________________
2/*
3 Copyright (c) 2003-2025, The GENIE Collaboration
4 For the full text of the license visit http://copyright.genie-mc.org
5
6 Daniel Scully ( d.i.scully \at warwick.ac.uk)
7 University of Warwick
8*/
9//____________________________________________________________________________
10
11#include <iostream>
12#include <sstream>
13#include <string>
14#include <complex>
15#include <vector>
16
18
19namespace genie
20{
21namespace alvarezruso
22{
23
24ARWavefunction::ARWavefunction(unsigned int sampling_in, bool debug)
25 : debug_(debug),
26 sampling_(2*sampling_in),
27 wavefunction_(sampling_, std::vector<std::complex<double> >(sampling_, std::complex<double> (0.0,0.0)) )
28{
29 if(debug_) std::cerr << "WF@ Constructor" << std::endl;
30}
31
33
34std::string ARWavefunction::print() const
35{
36 std::ostringstream oss;
37 oss << "{";
38 for(unsigned int i = 0; i != sampling_; ++i)
39 {
40 oss << "[";
41 for(unsigned int j = 0; j != sampling_; ++j)
42 {
43 oss << ((*this)[i][j]);
44 if( j != (sampling_ - 1) ) oss << ", ";
45 }
46 oss << "]";
47 }
48 oss << "}";
49 return oss.str();
50}
51
52const std::vector<std::complex<double> >& ARWavefunction::operator[] (unsigned int i) const
53{
54 return wavefunction_[i];
55}
56
57const std::complex<double> & ARWavefunction::operator() (unsigned int i, unsigned int j) const
58{
59 return wavefunction_[i][j];
60}
61
62std::complex<double> ARWavefunction::get(unsigned int i, unsigned int j) const
63{
64 return wavefunction_[i][j];
65}
66
67void ARWavefunction::set(unsigned int i, unsigned int j, const std::complex<double> & value)
68{
69 wavefunction_[i][j] = value;
70}
71
72unsigned int ARWavefunction::sampling() const { return sampling_; }
73
74} //namespace alvarezruso
75} //namespace genie
void set(unsigned int i, unsigned int j, const std::complex< double > &value)
std::complex< double > get(unsigned int i, unsigned int j) const
ARWavefunction(unsigned int sampling_in, bool debug=false)
const std::complex< double > & operator()(unsigned int i, unsigned int j) const
const std::vector< std::complex< double > > & operator[](unsigned int i) const
std::vector< std::vector< std::complex< double > > > wavefunction_
THE MAIN GENIE PROJECT NAMESPACE
Definition AlgCmp.h:25