Commit 2a392ef2 authored by Alvarez, Gonzalo's avatar Alvarez, Gonzalo
Browse files

added readme and license files

parent 0fb28f4a
Copyright (c) 2009 , UT-Battelle, LLC
All rights reserved
[PsimagLite, Version 1.0.0]
[by G.A., Oak Ridge National Laboratory]
UT Battelle Open Source Software License 11242008
OPEN SOURCE LICENSE
Subject to the conditions of this License, each
contributor to this software hereby grants, free of
charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), a
perpetual, worldwide, non-exclusive, no-charge,
royalty-free, irrevocable copyright license to use, copy,
modify, merge, publish, distribute, and/or sublicense
copies of the Software.
1. Redistributions of Software must retain the above
copyright and license notices, this list of conditions,
and the following disclaimer. Changes or modifications
to, or derivative works of, the Software should be noted
with comments and the contributor and organization's
name.
2. Neither the names of UT-Battelle, LLC or the
Department of Energy nor the names of the Software
contributors may be used to endorse or promote products
derived from this software without specific prior written
permission of UT-Battelle.
3. The software and the end-user documentation included
with the redistribution, with or without modification,
must include the following acknowledgment:
"This product includes software produced by UT-Battelle,
LLC under Contract No. DE-AC05-00OR22725 with the
Department of Energy."
*********************************************************
DISCLAIMER
THE SOFTWARE IS SUPPLIED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT OWNER, CONTRIBUTORS, UNITED STATES GOVERNMENT,
OR THE UNITED STATES DEPARTMENT OF ENERGY BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
NEITHER THE UNITED STATES GOVERNMENT, NOR THE UNITED
STATES DEPARTMENT OF ENERGY, NOR THE COPYRIGHT OWNER, NOR
ANY OF THEIR EMPLOYEES, REPRESENTS THAT THE USE OF ANY
INFORMATION, DATA, APPARATUS, PRODUCT, OR PROCESS
DISCLOSED WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS.
*********************************************************
PsimagLite contains utilities for use in codes for the simulation of strongly correlated electrons.
It is inspired in T.S.'s Psimag software (but it is not a fork of Psimag).
The amount of functionality included in PsimagLite will be exactly this (subject to change):
ModuleName Description
[Misc] PSIMAGAssert.h
[LinearAlgebra] Includes BLAS/LAPACK wrappers, Matrix.h and a new Vector.h class.
[Json] Json support (taken from M.S.'s new implementation which doesn't depend on anything at all)
[Xml] Xml support (M.S.'s Tag*.h files) I will include but not maintain this.
[Io] Brandnew and fresh input output support
[Concurrency] Concurrency classes taken from DCA++ (gbranch)
[SystemInfo] Basic time/date capability, os, hostname, compiler info
[Profiling] Profiling through constructor/destructor paradigm as done by M.S in DCA++
[RandomNumberGenerator] Will include a good rng and a bad one/easy one for testing
[Interpolation] Akima splines
The reason for PsimagLite is to share code among SpinPhononFermion, DCA++ and DMRG++.
PsimagLite is free software (see file LICENSE)
PsimagLite and DMRG++
Users will notice no change. Developers should not change DMRG++'s PSimagLite but do development on PsimagLite's separate repo instead. The fact that PsimagLite is in DMRG++'s repo is simply a convenience for users.
In the future, users might need to download PsimagLite to be able to compile DMRG++. I will post a notice if this becomes true.
PsimagLite and SpinPhononFermion
Same as DMRG++ above.
......@@ -2,17 +2,24 @@
#define AKIMA_H_
//! A class to interpolate using akima spline
template<typename VectorType>
class Akima {
typedef typename VectorType::ValueType RealType;
struct AkimaStruct {
RealType x0,x1,a0,a1,a2,a3;
};
public:
Akima(const VectorType& x,const VectorType& s)
{
if (x.size()!=s.size())
throw std::runtime_error("Number of X and Y points must be the same\n");
std::vector<RealType> sprime;
calculateSprime(sprime,x,s);
for (size_t i=0;i<n;i++) {
for (size_t i=0;i<x.size();i++) {
RealType u = x[i+1]-x[i];
RealType a2 = u*(sprime[i+1]-sprime[i])-2*(s[i+1]-s[i]));
RealType a3 = 3*u*(s[i+1]-s[i])-u*u*(sprime[i+1]+2*sprime[i]);
......@@ -52,6 +59,27 @@ class Akima {
return i;
}
void calculateSprime(VectorType& sprime,const VectorType& x,const VectorType& s)
{
VectorType d,w;
calculateD(d,x,s);
for (size_t i=0;i<x.size();i++) {
if (cornerCase()) {
// do corner case
continue;
}
sprime[i] = w[i]*d[i]+w[i+1]*d[i+1];
sprime[i] /= (w[i]+w[i+1]);
}
}
void calculateD(VectorType& d,const VectorType& x,const VectorType& s)
{
for (size_t i=2;i<x.size();i++)
d[i] = (s[i+1]-s[i])/(x[i+1]-x[i]);
}
std::vector<AkimaStruct> akimaStruct_;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment