Skip to content

Commit 5877a58

Browse files
committed
1. rename some files and functions
1 parent 1346e96 commit 5877a58

File tree

12 files changed

+57
-43
lines changed

12 files changed

+57
-43
lines changed

include/RI/global/Map_Operator.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,16 @@ namespace Map_Operator
5353
return m;
5454
}
5555

56+
// -m_in
57+
template<typename Tkey, typename Tvalue>
58+
std::map<Tkey,Tvalue> operator-(const std::map<Tkey,Tvalue> &m_in)
59+
{
60+
std::map<Tkey,Tvalue> m;
61+
for(const auto &item : m_in)
62+
m.emplace_hint(m.end(), item.first, -item.second);
63+
return m;
64+
}
65+
5666
// m1-m2
5767
template<typename Tkey, typename Tvalue>
5868
std::map<Tkey,Tvalue> operator-(const std::map<Tkey,Tvalue> &m1, const std::map<Tkey,Tvalue> &m2)
@@ -87,16 +97,6 @@ namespace Map_Operator
8797
}
8898
return m;
8999
}
90-
91-
// -m_in
92-
template<typename Tkey, typename Tvalue>
93-
std::map<Tkey,Tvalue> operator-(const std::map<Tkey,Tvalue> &m_in)
94-
{
95-
std::map<Tkey,Tvalue> m;
96-
for(const auto &item : m_in)
97-
m.emplace_hint(m.end(), item.first, -item.second);
98-
return m;
99-
}
100100
}
101101

102102
}
File renamed without changes.
File renamed without changes.

include/RI/ri/LRI-cal.hpp renamed to include/RI/ri/LRI-cal-loop4.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace RI
1818
{
1919

2020
template<typename TA, typename Tcell, std::size_t Ndim, typename Tdata>
21-
void LRI<TA,Tcell,Ndim,Tdata>::cal(
21+
void LRI<TA,Tcell,Ndim,Tdata>::cal_loop4(
2222
const std::vector<Label::ab_ab> &labels,
2323
std::vector<std::map<TA, std::map<TAC, Tensor<Tdata>>>> &Ds_result)
2424
{

include/RI/ri/LRI.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class LRI
6666
// const std::string &label,
6767
// const Tdata &threshold);
6868

69-
void cal(
69+
void cal_loop4(
7070
const std::vector<Label::ab_ab> &lables,
7171
std::vector<std::map<TA, std::map<TAC, Tensor<Tdata>>>> &Ds_result);
7272
void cal_loop3(
@@ -107,7 +107,7 @@ class LRI
107107

108108
#include "LRI.hpp"
109109
#include "LRI-set.hpp"
110-
#include "LRI-cal.hpp"
111-
#include "LRI-cal-b01.hpp"
112-
#include "LRI-cal-bx2.hpp"
110+
#include "LRI-cal-loop4.hpp"
111+
#include "LRI-cal-loop4-b01.hpp"
112+
#include "LRI-cal-loop4-bx2.hpp"
113113
#include "LRI-cal_loop3.hpp"

unittests/Test_All.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
#include "unittests/global/Tensor-test-3.hpp"
1515
#include "unittests/global/Tensor_Multiply-test.hpp"
1616
#include "unittests/global/Map_Operator-test.hpp"
17-
#include "unittests/ri/LRI-test.hpp"
18-
#include "unittests/ri/LRI_Loop3-test.hpp"
17+
#include "unittests/ri/LRI-loop4-test.hpp"
18+
#include "unittests/ri/LRI-loop3-test.hpp"
1919
#include "unittests/ri/LRI-speed-test.hpp"
2020
#include "unittests/ri/Cell_Nearest-test.hpp"
2121
#include "unittests/physics/Exx-test.hpp"
@@ -61,10 +61,10 @@ namespace Test_All
6161
Map_Operator_Test::test_transform_map();
6262
Map_Operator_Test::test_for_each_map();
6363

64-
LRI_Test::main<float>(argc, argv);
65-
LRI_Test::main<double>(argc, argv);
66-
LRI_Test::main<std::complex<float>>(argc, argv);
67-
LRI_Test::main<std::complex<double>>(argc, argv);
64+
LRI_Loop4_Test::main<float>(argc, argv);
65+
LRI_Loop4_Test::main<double>(argc, argv);
66+
LRI_Loop4_Test::main<std::complex<float>>(argc, argv);
67+
LRI_Loop4_Test::main<std::complex<double>>(argc, argv);
6868

6969
LRI_Loop3_Test::main<float>(argc, argv);
7070
LRI_Loop3_Test::main<double>(argc, argv);

unittests/comm/mix/Communicate_Tensors-test.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
#include "RI/comm/mix/Communicate_Tensors_Map_Judge.h"
99
#include "RI/global/MPI_Wrapper.h"
10-
#include "unittests/print_stl.h"
1110
#include "unittests/global/Tensor-test.h"
11+
#include "unittests/print_stl.h"
1212

1313
#include <mpi.h>
1414
#include <map>

unittests/global/Tensor-test.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ std::ostream &operator<<(std::ostream &os, const RI::Tensor<T> &t)
6363
}
6464
}
6565

66-
6766
//int main1()
6867
//{
6968
// RI::Tensor<double> t1({2,3});

unittests/print_stl.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,21 @@
1212
#include <tuple>
1313
#include <iostream>
1414

15+
template<typename T>
16+
std::ostream &operator<<(std::ostream &os, const std::vector<T> &v);
17+
template<typename T0, typename T1>
18+
std::ostream &operator<<(std::ostream &os, const std::tuple<T0,T1> &t);
19+
template<typename T>
20+
std::ostream &operator<<(std::ostream &os, const std::set<T> &s);
21+
template<typename T, std::size_t N>
22+
std::ostream &operator<<(std::ostream &os, const std::array<T,N> &v);
23+
template<typename Tkey, typename Tvalue>
24+
std::ostream &operator<<(std::ostream &os, const std::pair<Tkey,Tvalue> &p);
25+
template<typename Tkey, typename Tvalue>
26+
std::ostream &operator<<(std::ostream &os, const std::map<Tkey,Tvalue> &m);
27+
template<typename T0, typename T1>
28+
std::ostream &operator<<(std::ostream &os, const std::tuple<T0,T1> &t);
29+
1530
template<typename T>
1631
std::ostream &operator<<(std::ostream &os, const std::vector<T> &v)
1732
{
File renamed without changes.

0 commit comments

Comments
 (0)