funkalicious 0.1

wavefunction_simple_operations.h

Go to the documentation of this file.
00001 /**Performs very simple operations on dotcode wavefunctions.
00002 
00003     Copyright (C) 2011 Joseph Pingenot
00004 
00005     This program is free software: you can redistribute it and/or modify
00006     it under the terms of the GNU Affero General Public License as published by
00007     the Free Software Foundation, either version 3 of the License, or
00008     (at your option) any later version.
00009 
00010     This program is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013     GNU Affero General Public License for more details.
00014 
00015     You should have received a copy of the GNU Affero General Public License
00016     along with this program.  If not, see <http://www.gnu.org/licenses/>.
00017 
00018 */
00019 
00020 #include <libpostproc/lp_wavefunction.h>
00021 #include <libdotcode/dotcode_wavefunction.h>
00022 
00023 #ifndef ____LIBDOTCODE_WAVEFUNCTION_SIMPLE_OPERATIONS_H___
00024 #define ____LIBDOTCODE_WAVEFUNCTION_SIMPLE_OPERATIONS_H___
00025 
00026 /**Gets the percentage of the wavefunction that is in the band (range is [0, 1])
00027  *\param wf pointer to the wavefunction
00028  *\param band the band to examine
00029  *\return percentage of the wavefunction in the specified band (range is [0, 1])
00030  *   (NaN if there was an error)
00031  */
00032 double dotcode_wavefunction_get_percentage_in_band(const struct wavefunction* wf, int band);
00033 
00034 /**Calculates product of two real-valued wavefunctions and a complex-valued callback f, <b|f|a>, using a cheesy summation (not only is the summation itself cheesy, but this method of doing it is cheesy. But seems to work.)
00035  *\param b wavefunction b
00036  *\param f real-valued callback: accepts x, y, z, pointers to real and imaginary value of f at this point, and private data
00037  *\param a wavefunction a
00038  *\param value_re real value of the integral
00039  *\param value_im imaginary value of the integral
00040  *\param privdat private data to be passed to f when it's called
00041  */
00042 void dotcode_wavefunction_integrate_sum(const struct wavefunction* b, void (*f)(double x, double y, double z, double* re, double* im, void* privdat), const struct wavefunction* a, double* value_re, double* value_im, void* privdat);
00043 /**Calculates product of two real-valued wavefunctions and a complex-valued callback f, <b|f|a>, using a cheesy summation (not only is the summation itself cheesy, but this method of doing it is cheesy. But seems to work.)
00044  *\param b wavefunction b
00045  *\param f real-valued callback: accepts x, y, z, pointers to real and imaginary value of f at this point, and private data
00046  *\param a wavefunction a
00047  *\param value pointer to a two-element double array, value[0] is the real value of the integral and value[1] is the imaginary value
00048  *\param privdat private data to be passed to f when it's called
00049  */
00050 void dotcode_wavefunction_integrate_sum_1(const struct wavefunction* b, void (*f)(double x, double y, double z, double* re, double* im, void* privdat), const struct wavefunction* a, double* value, void* privdat);
00051 /**Parallelized: calculates product of two real-valued wavefunctions and a complex-valued callback f, <b|f|a>, using a cheesy summation (not only is the summation itself cheesy, but this method of doing it is cheesy. But seems to work.)
00052  *\param b wavefunction b
00053  *\param f real-valued callback: accepts x, y, z, pointers to real and imaginary value of f at this point, and private data
00054  *\param a wavefunction a
00055  *\param value_re real value of the integral
00056  *\param value_im imaginary value of the integral
00057  *\param privdat array private data to be passed to f when it's called (if NULL, NULL will be passed to f)
00058  */
00059 void dotcode_wavefunction_integrate_sum_parallel(const struct wavefunction* b, void (*f)(double x, double y, double z, double* re, double* im, void* privdat), const struct wavefunction* a, double* value_re, double* value_im, void** privdat);
00060 /**Parallelized: calculates product of two real-valued wavefunctions and a complex-valued callback f, <b|f|a>, using a cheesy summation (not only is the summation itself cheesy, but this method of doing it is cheesy. But seems to work.)
00061  *\param b wavefunction b
00062  *\param f real-valued callback: accepts x, y, z, pointers to real and imaginary value of f at this point, and private data
00063  *\param a wavefunction a
00064  *\param value pointer to a two-element double array, value[0] is the real value of the integral and value[1] is the imaginary value
00065  *\param privdat array private data to be passed to f when it's called (if NULL, NULL will be passed to f)
00066  */
00067 void dotcode_wavefunction_integrate_sum_parallel_1(const struct wavefunction* b, void (*f)(double x, double y, double z, double* re, double* im, void* privdat), const struct wavefunction* a, double* value, void** privdat);
00068 
00069 
00070 #endif
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines