Exemplo n.º 1
0
			BOOTIL_EXPORT bool Floats( const BString & str, float* f, int iCount )
			{
				String::List lst;
				String::Util::Split( str, " ", lst );

				if ( lst.size() != iCount ) { return false; }

				for ( int i = 0; i < iCount; i++ )
				{
					f[i] = String::To::Float( lst[i] );
				}

				return true;
			}
Exemplo n.º 2
0
    void diagonal2(const String::List<Index> &alpha, const String &beta,
                   const mpqc::Matrix &V, mpqc::Vector &d) {
        //MPQC_PROFILE_LINE;
	const auto &b = beta.occ();
        BOOST_FOREACH (auto j, b) {
            size_t jj = index(j,j);
            auto const &Vj = V.col(jj);
            for (int k = 0; k < alpha.size(); ++k) {
                double q = 0;
                const auto &a = alpha[k].occ();
                BOOST_FOREACH (auto i, a) {
                    size_t ii = index(i,i);
                    q += Vj(i);
                }
                d(k) += q;
            }