Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/seferim-agi-g16 / include/common/weights.hpp |
| Date | Not specified in source |
| Repository | Janady13/seferim-agi-g16 |
| Revision | 25f281b08b2f786f5a235b5abebfc39bf44d1044 |
| Branch | main |
| Path or archive member | include/common/weights.hpp |
| Original SHA-256 | 88ea560ee11ebd16280104ea4bb9ed1712a827a14ac5953e5181e20672bcfbd8 |
| Git blob SHA | aff150862f47749903723bc6e932bf6ef7a3f07f |
| Reading-copy SHA-256 | 88ea560ee11ebd16280104ea4bb9ed1712a827a14ac5953e5181e20672bcfbd8 |
Every recorded occurrence
These 2 records contain identical original source bytes. Their paths and revisions remain part of the archive.
| Original record | Branch or archive | Revision / identifier | Original location |
|---|---|---|---|
| Janady13/seferim-agi-g16 / include/common/weights.hpp | main | 25f281b08b2f786f5a235b5abebfc39bf44d1044 | Open original |
| Janady13/seferim-agi-g16 / include/common/weights.hpp | copilot/update-code-libraries | 393af96a270295f79582b2b2a77bb49dd1a9a990 | Open original |
Recovered source transcript
Download complete source text ↓29 lines · 0.7 KB
#pragma once
#include <array>
#include <cstdlib>
#include <string>
#include <string_view>
#include <vector>
namespace common {
inline std::array<double,16> get_weights() {
std::array<double,16> w{};
for (auto& x : w) x = 1.0;
const char* env = std::getenv("G16_WEIGHTS");
if (!env) return w;
std::string s(env);
size_t start = 0;
for (int i = 0; i < 16 && start < s.size(); ++i) {
size_t comma = s.find(',', start);
std::string tok = s.substr(start, comma == std::string::npos ? std::string::npos : comma - start);
try { w[i] = std::stod(tok); } catch (...) {}
if (comma == std::string::npos) break;
start = comma + 1;
}
return w;
}
} // namespace common