-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: relocate temp file functions to header
- Loading branch information
Showing
5 changed files
with
54 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* Copyright (C) 1998-2016 ALPS Collaboration. See COPYRIGHT.TXT | ||
* All rights reserved. Use is subject to license terms. See LICENSE.TXT | ||
* For use in publications, see ACKNOWLEDGE.TXT | ||
*/ | ||
#include <iostream> | ||
#pragma once | ||
|
||
void write_minimal_param_file(const std::string &str){ | ||
std::ofstream tmpfile(str.c_str()); | ||
tmpfile<<"BETA=2" <<std::endl; | ||
tmpfile<<"X_0=.1" <<std::endl; | ||
tmpfile<<"X_1=.2" <<std::endl; | ||
tmpfile<<"X_2=.3" <<std::endl; | ||
tmpfile<<"X_3=.4" <<std::endl; | ||
tmpfile<<"SIGMA_0=.5" <<std::endl; | ||
tmpfile<<"SIGMA_1=.5" <<std::endl; | ||
tmpfile<<"SIGMA_2=.5" <<std::endl; | ||
tmpfile<<"SIGMA_3=.5" <<std::endl; | ||
tmpfile.close(); | ||
} | ||
void write_minimal_input_file(const std::string &str){ | ||
std::ofstream tmpfile(str.c_str()); | ||
tmpfile<<0<<" "<<-0.4<<" "<<0.01<<std::endl; | ||
tmpfile<<1<<" "<<-0.2<<" "<<0.01<<std::endl; | ||
tmpfile<<2<<" "<<-0.2<<" "<<0.01<<std::endl; | ||
tmpfile<<3<<" "<<-0.5<<" "<<0.01<<std::endl; | ||
tmpfile<<4<<" "<<-0.6<<" "<<0.01<<std::endl; | ||
tmpfile.close(); | ||
|
||
} | ||
//default model | ||
void write_minimal_tab_file(const std::string &str){ | ||
{ | ||
std::ofstream tmpfile(str.c_str()); | ||
tmpfile<<-20<<" "<<1./40<<std::endl; | ||
tmpfile<<20<<" "<<1./40<<std::endl; | ||
tmpfile.close(); | ||
} | ||
} | ||
void write_tab_file_with_junk(const std::string &str){ | ||
{ | ||
std::ofstream tmpfile(str.c_str()); | ||
tmpfile<<"# this is a file with junk in it."<<std::endl; | ||
tmpfile<<-20<<" "<<1./40<<" default model data" <<std::endl; | ||
tmpfile<<20<<" "<<1./40<<std::endl; | ||
tmpfile.close(); | ||
} | ||
} |