OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
c_hash_table.cpp File Reference
#include <unordered_map>
#include <iostream>
#include <vector>

Go to the source code of this file.

Macros

#define _FCALL

Functions

void c_new_hash_ (int *map_id, int *count)
void c_delete_hash_ (int *map)
void c_hash_find_ (int *map_id, int *key, int *val)
void c_hash_insert_ (int *map_id, int *key, int *val)
void c_hash_replace_ (int *map_id, int *key, int *val)
void _FCALL C_NEW_HASH (int *map, int *count)
void c_new_hash__ (int *map, int *count)
void c_new_hash (int *map, int *count)
void _FCALL C_DELETE_HASH (int *map)
void c_delete_hash__ (int *map)
void c_delete_hash (int *map)
void _FCALL C_HASH_FIND (int *map, int *key, int *val)
void c_hash_find__ (int *map, int *key, int *val)
void c_hash_find (int *map, int *key, int *val)
void _FCALL C_HASH_INSERT (int *map, int *key, int *val)
void c_hash_insert__ (int *map, int *key, int *val)
void c_hash_insert (int *map, int *key, int *val)
void _FCALL C_HASH_REPLACE (int *map, int *key, int *val)
void c_hash_replace__ (int *map, int *key, int *val)
void c_hash_replace (int *map, int *key, int *val)

Variables

std::vector< std::unordered_map< int, int > > umaps

Macro Definition Documentation

◆ _FCALL

#define _FCALL

Definition at line 27 of file c_hash_table.cpp.

Function Documentation

◆ C_DELETE_HASH()

void _FCALL C_DELETE_HASH ( int * map)

Definition at line 108 of file c_hash_table.cpp.

109 {
110 c_delete_hash_(map);
111 }
void c_delete_hash_(int *map)

◆ c_delete_hash()

void c_delete_hash ( int * map)

Definition at line 116 of file c_hash_table.cpp.

117 {
118 c_delete_hash_(map);
119 }

◆ c_delete_hash_()

void c_delete_hash_ ( int * map)

Definition at line 40 of file c_hash_table.cpp.

41 {
42 if(*map >= umaps.size() || *map < 0)
43 {
44
45 } else
46 {
47 umaps[*map].clear();
48 }
49 }
std::vector< std::unordered_map< int, int > > umaps

◆ c_delete_hash__()

void c_delete_hash__ ( int * map)

Definition at line 112 of file c_hash_table.cpp.

113 {
114 c_delete_hash_(map);
115 }

◆ C_HASH_FIND()

void _FCALL C_HASH_FIND ( int * map,
int * key,
int * val )

Definition at line 121 of file c_hash_table.cpp.

122 {
123 c_hash_find_(map, key, val);
124 }
void c_hash_find_(int *map_id, int *key, int *val)

◆ c_hash_find()

void c_hash_find ( int * map,
int * key,
int * val )

Definition at line 129 of file c_hash_table.cpp.

130 {
131 c_hash_find_(map, key, val);
132 }

◆ c_hash_find_()

void c_hash_find_ ( int * map_id,
int * key,
int * val )

Definition at line 52 of file c_hash_table.cpp.

53 {
54 if(*map_id >= 0 && *map_id < umaps.size())
55 {
56 int s = umaps[*map_id].size();
57 int keyloc = *key;
58 std::unordered_map<int,int>::const_iterator got = umaps[*map_id].find(keyloc);
59 if( got == umaps[*map_id].end() )
60 {
61 // not found, val is not changed
62 } else
63 {
64 (*val) = got->second;
65 }
66 }
67 }
end[inform, rinform, sol, inst, schur, redrhs, pivnul_list, sym_perm, uns_perm, icntl, cntl, colsca_out, rowsca_out, keep_out, dkeep_out]
Definition dmumps.m:40

◆ c_hash_find__()

void c_hash_find__ ( int * map,
int * key,
int * val )

Definition at line 125 of file c_hash_table.cpp.

126 {
127 c_hash_find_(map, key, val);
128 }

◆ C_HASH_INSERT()

void _FCALL C_HASH_INSERT ( int * map,
int * key,
int * val )

Definition at line 134 of file c_hash_table.cpp.

135 {
136 c_hash_insert_(map, key, val);
137 }
void c_hash_insert_(int *map_id, int *key, int *val)

◆ c_hash_insert()

void c_hash_insert ( int * map,
int * key,
int * val )

Definition at line 142 of file c_hash_table.cpp.

143 {
144 c_hash_insert_(map, key, val);
145 }

◆ c_hash_insert_()

void c_hash_insert_ ( int * map_id,
int * key,
int * val )

Definition at line 68 of file c_hash_table.cpp.

69 {
70 int ival = *val;
71 int imap_id = *map_id;
72 int ikey = *key;
73 if(*map_id >= 0 && *map_id < umaps.size())
74 {
75 std::unordered_map<int,int>::const_iterator got = umaps[imap_id].find(ikey);
76 if( got == umaps[imap_id].end() )
77 {
78 umaps[imap_id][ikey] = ival;
79 } else
80 {
81
82 }
83 }
84 }

◆ c_hash_insert__()

void c_hash_insert__ ( int * map,
int * key,
int * val )

Definition at line 138 of file c_hash_table.cpp.

139 {
140 c_hash_insert_(map, key, val);
141 }

◆ C_HASH_REPLACE()

void _FCALL C_HASH_REPLACE ( int * map,
int * key,
int * val )

Definition at line 147 of file c_hash_table.cpp.

148 {
149 c_hash_replace_(map, key, val);
150 }
void c_hash_replace_(int *map_id, int *key, int *val)

◆ c_hash_replace()

void c_hash_replace ( int * map,
int * key,
int * val )

Definition at line 155 of file c_hash_table.cpp.

156 {
157 c_hash_replace_(map, key, val);
158 }

◆ c_hash_replace_()

void c_hash_replace_ ( int * map_id,
int * key,
int * val )

Definition at line 85 of file c_hash_table.cpp.

86 {
87 if(*map_id >= 0 && *map_id < umaps.size())
88 {
89 std::unordered_map<int,int>::const_iterator got = umaps[*map_id].find(*key);
90 umaps[*map_id][*key] = *val;
91 }
92 }

◆ c_hash_replace__()

void c_hash_replace__ ( int * map,
int * key,
int * val )

Definition at line 151 of file c_hash_table.cpp.

152 {
153 c_hash_replace_(map, key, val);
154 }

◆ C_NEW_HASH()

void _FCALL C_NEW_HASH ( int * map,
int * count )

Definition at line 95 of file c_hash_table.cpp.

96 {
97 c_new_hash_(map,count);
98 }
void c_new_hash_(int *map_id, int *count)

◆ c_new_hash()

void c_new_hash ( int * map,
int * count )

Definition at line 103 of file c_hash_table.cpp.

104 {
105 c_new_hash_(map,count);
106 }

◆ c_new_hash_()

void c_new_hash_ ( int * map_id,
int * count )

Definition at line 34 of file c_hash_table.cpp.

35 {
36 umaps.push_back(std::unordered_map<int,int>());
37// c++11 add reserve of size count here
38 (*map_id) = umaps.size()-1;
39 }

◆ c_new_hash__()

void c_new_hash__ ( int * map,
int * count )

Definition at line 99 of file c_hash_table.cpp.

100 {
101 c_new_hash_(map,count);
102 }

Variable Documentation

◆ umaps

std::vector<std::unordered_map<int,int> > umaps

Definition at line 31 of file c_hash_table.cpp.