text:
module LZOS
using ..AGFFileReader: Glass, GlassID, AGF
export LZ_BF16, LZ_CTK8, LZ_TK12, LZ_K100, LZ_NEWGLASS, LZ_LK5, LZ_TF5, LZ_TF10, LZ_TF1, LZ_LF9, LZ_TK2, LZ_LK6, LZ_BK10, LZ_LK7, LZ_KF6, LZ_TK17, LZ_CTK9, LZ_CTK12, LZ_F13, LZ_TBF10, LZ_OK4, LZ_BF1, LZ_BF7, LZ_LF5, LZ_BF21, LZ_CTK19, LZ_BF25, LZ_F6, LZ_K8, LZ_TK20, LZ_TF4, LZ_F4, LZ_BF28, LZ_TK9, LZ_TK21, LZ_KF7, LZ_TF8, LZ_BK8, LZ_CTK3, LZ_F1, LZ_BK6, LZ_TF7, LZ_TF3, LZ_TK16, LZ_BF24, LZ_LF7, LZ_BF8, LZ_TK14, LZ_BF11, LZ_BK4, LZ_TF2, LZ_F8, LZ_OF1, LZ_LK3, LZ_TK23

const LZ_BF16 = Glass(GlassID(AGF, 1650), 1, 2.73156011, -0.00928065848, 0.0207033959, 0.000478409191, -6.64344655e-6, 2.01680308e-6, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, -0.0012, -1.0, -1.0, 8.4, -1.0, 0.0, -1.0, [(0.3, 1.0e-6, 10.0), (0.32, 1.0e-6, 10.0), (0.34, 0.047, 10.0), (0.36, 0.49, 10.0), (0.38, 0.831, 10.0), (0.4, 0.915, 10.0), (0.42, 0.957, 10.0), (0.44, 0.972, 10.0), (0.46, 0.981, 10.0), (0.48, 0.988, 10.0), (0.5, 0.992, 10.0), (0.52, 0.995, 10.0), (0.54, 0.996, 10.0), (0.56, 0.996, 10.0), (0.58, 0.996, 10.0), (0.6, 0.996, 10.0), (0.62, 0.995, 10.0), (0.64, 0.995, 10.0), (0.66, 0.995, 10.0), (0.68, 0.996, 10.0), (0.7, 0.996, 10.0), (0.75, 0.995, 10.0), (0.8, 0.995, 10.0), (0.9, 0.993, 10.0), (1.0, 0.993, 10.0), (1.05, 0.993, 10.0), (1.1, 0.993, 10.0), (1.2, 0.994, 10.0), (1.3, 0.994, 10.0), (1.4, 0.994, 10.0), (1.5, 0.993, 10.0), (1.5, 1.0e-6, 10.0)], 1.671024, -1.0, -1.0, 0, 47.298918, 0, 4.02, 0.0)
const LZ_CTK8 = Glass(GlassID(AGF, 1651), 1, 2.84777546, -0.0120274217, 0.0114858486, 0.00437207651, -0.000647076967, 3.76296896e-5, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, -0.0023, -1.0, -1.0, 9.2, -1.0, 0.0, -1.0, [(0.3, 1.0e-6, 10.0), (0.32, 1.0e-6, 10.0), (0.34, 1.0e-6, 10.0), (0.36, 1.0e-6, 10.0), (0.38, 1.0e-6, 10.0), (0.4, 0.947, 10.0), (0.42, 0.968, 10.0), (0.44, 0.977, 10.0), (0.46, 0.983, 10.0), (0.48, 0.988, 10.0), (0.5, 0.992, 10.0), (0.52, 0.995, 10.0), (0.54, 0.996, 10.0), (0.56, 0.996, 10.0), (0.58, 0.995, 10.0), (0.6, 0.995, 10.0), (0.62, 0.994, 10.0), (0.64, 0.994, 10.0), (0.66, 0.994, 10.0), (0.68, 0.995, 10.0), (0.7, 0.995, 10.0), (0.75, 0.996, 10.0), (0.8, 0.996, 10.0), (0.9, 0.995, 10.0), (1.0, 0.995, 10.0), (1.05, 0.995, 10.0), (1.1, 0.996, 10.0), (1.2, 0.996, 10.0), (1.3, 0.996, 10.0), (1.4, 0.996, 10.0), (1.5, 0.996, 10.0), (1.5, 1.0e-6, 10.0)], 1.703085, -1.0, -1.0, 0, 48.927733, 0, 4.16, 0.0)
const LZ_TK12 = Glass(GlassID(AGF, 1652), 1, 2.42940597, -0.011395594, 0.0104342309, 0.000984738195, -0.000127587405, 7.2645646e-6, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, -0.0004, -1.0, -1.0, 6.5, -1.0, 0.0, -1.0, [(0.3, 1.0e-6, 10.0), (0.32, 1.0e-6, 10.0), (0.34, 1.0e-6, 10.0), (0.36, 1.0e-6, 10.0), (0.38, 0.954, 10.0), (0.4, 0.985, 10.0), (0.42, 0.989, 10.0), (0.44, 0.989, 10.0), (0.46, 0.992, 10.0), (0.48, 0.994, 10.0), (0.5, 0.995, 10.0), (0.52, 0.996, 10.0), (0.54, 0.996, 10.0), (0.56, 0.996, 10.0), (0.58, 0.995, 10.0), (0.6, 0.995, 10.0), (0.62, 0.995, 10.0), (0.64, 0.994, 10.0), (0.66, 0.995, 10.0), (0.68, 0.995, 10.0), (0.7, 0.996, 10.0), (0.75, 0.996, 10.0), (0.8, 0.996, 10.0), (0.9, 0.995, 10.0), (1.0, 0.995, 10.0), (1.05, 0.995, 10.0), (1.1, 0.995, 10.0), (1.10001, 1.0e-6, 10.0)], 1.568875, -1.0, -1.0, 0, 62.675048, 0, 3.06, 0.0)
const LZ_K100 = Glass(GlassID(AGF, 1653), 1, 2.28815478, -0.00930968992, 0.000827843888, 0.00630164765, -0.00128813048, 9.15821978e-5, 0.0, 0.0, NaN, NaN, 0.40466, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, 0.0014, -1.0, -1.0, 7.8, -1.0, 0.0, -1.0, [(0.38, 0.882, 10.0), (0.4, 0.971, 10.0), (0.42, 0.982, 10.0), (0.44, 0.985, 10.0), (0.46, 0.989, 10.0), (0.48, 0.991, 10.0), (0.5, 0.993, 10.0), (0.52, 0.994, 10.0), (0.54, 0.995, 10.0), (0.56, 0.995, 10.0), (0.58, 0.994, 10.0), (0.6, 0.994, 10.0), (0.62, 0.993, 10.0), (0.64, 0.993, 10.0), (0.66, 0.994, 10.0), (0.68, 0.996, 10.0), (0.7, 0.996, 10.0), (0.75, 0.997, 10.0), (0.8, 0.997, 10.0), (0.9, 0.997, 10.0), (1.0, 0.997, 10.0), (1.05, 0.997, 10.0), (1.1, 0.997, 10.0), (1.2, 0.997, 10.0), (1.3, 0.997, 10.0), (1.4, 0.993, 10.0), (1.4001, 0.0, 10.0), (1.4002, 0.0, 10.0)], 1.521628, -1.0, -1.0, 0, 57.832325, 0, 2.63, 0.0)
const LZ_NEWGLASS = Glass(GlassID(AGF, 1654), 1, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, 0.0, -1.0, -1.0, 0.0, -1.0, 0.0, -1.0, [(0.3, 0.0, 10.0), (0.32, 0.0, 10.0), (0.34, 0.0, 10.0), (0.36, 0.0, 10.0), (0.38, 0.0, 10.0), (0.4, 0.0, 10.0), (0.42, 0.0, 10.0), (0.44, 0.0, 10.0), (0.46, 0.0, 10.0), (0.48, 0.0, 10.0), (0.5, 0.0, 10.0), (0.52, 0.0, 10.0), (0.54, 0.0, 10.0), (0.56, 0.0, 10.0), (0.58, 0.0, 10.0), (0.6, 0.0, 10.0), (0.62, 0.0, 10.0), (0.64, 0.0, 10.0), (0.66, 0.0, 10.0), (0.68, 0.0, 10.0), (0.7, 0.0, 10.0), (0.75, 0.0, 10.0), (0.8, 0.0, 10.0), (0.9, 0.0, 10.0), (1.0, 0.0, 10.0), (1.1, 0.0, 10.0), (1.2, 0.0, 10.0), (1.3, 0.0, 10.0), (1.4, 0.0, 10.0), (1.5, 0.0, 10.0)], 1.55, -1.0, -1.0, 0, 30.0, 0, 1.0, 0.0)
const LZ_LK5 = Glass(GlassID(AGF, 1655), 1, 2.16172762, -0.010680729, 0.0078959556, 0.000701313828, -9.09783305e-5, 5.12053096e-6, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, -0.0012, -1.0, -1.0, 3.5, -1.0, 0.0, -1.0, [(0.32, 0.141, 10.0), (0.34, 0.596, 10.0), (0.36, 0.854, 10.0), (0.38, 0.914, 10.0), (0.4, 0.973, 10.0), (0.42, 0.973, 10.0), (0.44, 0.975, 10.0), (0.46, 0.984, 10.0), (0.48, 0.987, 10.0), (0.5, 0.99, 10.0), (0.52, 0.992, 10.0), (0.54, 0.993, 10.0), (0.56, 0.993, 10.0), (0.58, 0.991, 10.0), (0.6, 0.99, 10.0), (0.62, 0.99, 10.0), (0.64, 0.99, 10.0), (0.66, 0.991, 10.0), (0.68, 0.992, 10.0), (0.7, 0.993, 10.0), (0.75, 0.995, 10.0), (0.8, 0.995, 10.0), (0.9, 0.995, 10.0), (1.0, 0.994, 10.0), (1.05, 0.994, 10.0), (1.1, 0.994, 10.0), (1.2, 0.994, 10.0), (1.3, 0.994, 10.0), (1.4, 0.97, 10.0), (1.5, 0.992, 10.0), (1.5001, 0.0, 10.0), (1.5002, 0.0, 10.0)], 1.478156, -1.0, -1.0, 0, 65.29558, 0, 2.27, 0.0)
const LZ_TF5 = Glass(GlassID(AGF, 1656), 1, 2.96058035, -0.0093389098, 0.0373866774, 0.00188114598, -6.3553719e-5, 1.35532965e-5, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, 0.0056, -1.0, -1.0, 8.3, -1.0, 0.0, -1.0, [(0.3, 1.0e-6, 10.0), (0.32, 1.0e-6, 10.0), (0.34, 1.0e-6, 10.0), (0.36, 0.063, 10.0), (0.38, 0.444, 10.0), (0.4, 0.806, 10.0), (0.42, 0.904, 10.0), (0.44, 0.956, 10.0), (0.46, 0.975, 10.0), (0.48, 0.985, 10.0), (0.5, 0.99, 10.0), (0.52, 0.994, 10.0), (0.54, 0.995, 10.0), (0.56, 0.996, 10.0), (0.58, 0.995, 10.0), (0.6, 0.995, 10.0), (0.62, 0.993, 10.0), (0.64, 0.993, 10.0), (0.66, 0.993, 10.0), (0.68, 0.994, 10.0), (0.7, 0.995, 10.0), (0.75, 0.997, 10.0), (0.8, 0.997, 10.0), (0.9, 0.997, 10.0), (1.0, 0.997, 10.0), (1.05, 0.997, 10.0), (1.1, 0.997, 10.0), (1.2, 0.997, 10.0), (1.3, 0.998, 10.0), (1.4, 0.997, 10.0), (1.5, 0.995, 10.0), (1.5, 1.0e-6, 10.0)], 1.755234, -1.0, -1.0, 0, 27.512609, 0, 4.77, 0.0)
const LZ_TF10 = Glass(GlassID(AGF, 1657), 1, 3.12158254, -0.00958842044, 0.0417028532, 0.00329045461, -0.000251146907, 2.92306112e-5, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, 0.0075, -1.0, -1.0, 8.1, -1.0, 0.0, -1.0, [(0.3, 1.0e-6, 10.0), (0.32, 1.0e-6, 10.0), (0.34, 1.0e-6, 10.0), (0.36, 1.0e-6, 10.0), (0.38, 0.24, 10.0), (0.4, 0.61, 10.0), (0.42, 0.848, 10.0), (0.44, 0.931, 10.0), (0.46, 0.967, 10.0), (0.48, 0.984, 10.0), (0.5, 0.991, 10.0), (0.52, 0.994, 10.0), (0.54, 0.996, 10.0), (0.56, 0.997, 10.0), (0.58, 0.997, 10.0), (0.6, 0.996, 10.0), (0.62, 0.995, 10.0), (0.64, 0.995, 10.0), (0.66, 0.995, 10.0), (0.68, 0.996, 10.0), (0.7, 0.997, 10.0), (0.75, 0.998, 10.0), (0.8, 0.997, 10.0), (0.9, 0.997, 10.0), (1.0, 0.997, 10.0), (1.05, 0.997, 10.0), (1.1, 0.997, 10.0), (1.2, 0.997, 10.0), (1.3, 0.997, 10.0), (1.4, 0.993, 10.0), (1.5, 0.997, 10.0), (1.5, 1.0e-6, 10.0)], 1.806276, -1.0, -1.0, 0, 25.353304, 0, 5.19, 0.0)
const LZ_TF1 = Glass(GlassID(AGF, 1658), 1, 2.63683784, -0.00915649038, 0.0244839699, 0.00136956866, -7.89238359e-5, 8.68758585e-6, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, 0.0006, -1.0, -1.0, 8.6, -1.0, 0.0, -1.0, [(0.3, 1.0e-6, 10.0), (0.32, 1.0e-6, 10.0), (0.34, 1.0e-6, 10.0), (0.36, 1.0e-6, 10.0), (0.38, 0.84, 10.0), (0.4, 0.96, 10.0), (0.42, 0.977, 10.0), (0.44, 0.983, 10.0), (0.46, 0.988, 10.0), (0.48, 0.991, 10.0), (0.5, 0.993, 10.0), (0.52, 0.995, 10.0), (0.54, 0.996, 10.0), (0.56, 0.996, 10.0), (0.58, 0.996, 10.0), (0.6, 0.995, 10.0), (0.62, 0.994, 10.0), (0.64, 0.994, 10.0), (0.66, 0.994, 10.0), (0.68, 0.995, 10.0), (0.7, 0.995, 10.0), (0.75, 0.997, 10.0), (0.8, 0.998, 10.0), (0.9, 0.997, 10.0), (1.0, 0.997, 10.0), (1.05, 0.997, 10.0), (1.1, 0.997, 10.0), (1.2, 0.996, 10.0), (1.3, 0.997, 10.0), (1.4, 0.993, 10.0), (1.5, 0.993, 10.0), (1.5, 1.0e-6, 10.0)], 1.64766, -1.0, -1.0, 0, 33.843147, 0, 3.86, 0.0)
const LZ_LF9 = Glass(GlassID(AGF, 1659), 1, 2.43971558, -0.0100883571, 0.0175323123, 0.00149801974, -0.000153207988, 1.33947598e-5, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, 0.0055, -1.0, -1.0, 8.9, -1.0, 0.0, -1.0, [(0.3, 1.0e-6, 10.0), (0.32, 1.0e-6, 10.0), (0.34, 1.0e-6, 10.0), (0.36, 1.0e-6, 10.0), (0.38, 0.885, 10.0), (0.4, 0.93, 10.0), (0.42, 0.961, 10.0), (0.44, 0.97, 10.0), (0.46, 0.981, 10.0), (0.48, 0.984, 10.0), (0.5, 0.988, 10.0), (0.52, 0.991, 10.0), (0.54, 0.992, 10.0), (0.56, 0.993, 10.0), (0.58, 0.994, 10.0), (0.6, 0.993, 10.0), (0.62, 0.992, 10.0), (0.64, 0.992, 10.0), (0.66, 0.992, 10.0), (0.68, 0.993, 10.0), (0.7, 0.994, 10.0), (0.75, 0.997, 10.0), (0.8, 0.999, 10.0), (0.9, 0.999, 10.0), (1.0, 0.999, 10.0), (1.05, 0.999, 10.0), (1.1, 0.999, 10.0), (1.10001, 1.0e-6, 10.0)], 1.580128, -1.0, -1.0, 0, 37.952693, 0, 2.61, 0.0)
const LZ_TK2 = Glass(GlassID(AGF, 1660), 1, 2.43491314, -0.00919944304, 0.0124374705, 0.00080428226, -8.9719479e-5, 5.20398686e-6, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, 0.0003, -1.0, -1.0, 7.0, -1.0, 0.0, -1.0, [(0.3, 0.0, 10.0), (0.32, 0.0, 10.0), (0.34, 0.827, 10.0), (0.36, 0.91, 10.0), (0.38, 0.958, 10.0), (0.4, 0.985, 10.0), (0.42, 0.989, 10.0), (0.44, 0.989, 10.0), (0.46, 0.992, 10.0), (0.48, 0.993, 10.0), (0.5, 0.994, 10.0), (0.52, 0.995, 10.0), (0.54, 0.995, 10.0), (0.56, 0.995, 10.0), (0.58, 0.996, 10.0), (0.6, 0.994, 10.0), (0.62, 0.994, 10.0), (0.64, 0.993, 10.0), (0.66, 0.993, 10.0), (0.68, 0.993, 10.0), (0.7, 0.993, 10.0), (0.75, 0.993, 10.0), (0.8, 0.992, 10.0), (0.9, 0.99, 10.0), (1.0, 0.989, 10.0), (1.05, 0.989, 10.0), (1.1, 0.989, 10.0), (1.1001, 0.0, 10.0), (1.1002, 0.0, 10.0)], 1.572482, -1.0, -1.0, 0, 57.325385, 0, 3.2, 0.0)
const LZ_LK6 = Glass(GlassID(AGF, 1661), 1, 2.13954871, -0.00974500629, 0.00776174717, 0.000612372701, -7.65186333e-5, 4.28387671e-6, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, 0.0017, -1.0, -1.0, 8.2, -1.0, 0.0, -1.0, [(0.3, 0.0, 10.0), (0.32, 0.478, 10.0), (0.34, 0.834, 10.0), (0.36, 0.949, 10.0), (0.38, 0.954, 10.0), (0.4, 0.987, 10.0), (0.42, 0.982, 10.0), (0.44, 0.983, 10.0), (0.46, 0.989, 10.0), (0.48, 0.992, 10.0), (0.5, 0.994, 10.0), (0.52, 0.995, 10.0), (0.54, 0.996, 10.0), (0.56, 0.995, 10.0), (0.58, 0.994, 10.0), (0.6, 0.994, 10.0), (0.62, 0.993, 10.0), (0.64, 0.992, 10.0), (0.66, 0.993, 10.0), (0.68, 0.994, 10.0), (0.7, 0.994, 10.0), (0.75, 0.996, 10.0), (0.8, 0.997, 10.0), (0.9, 0.998, 10.0), (1.0, 0.998, 10.0), (1.05, 0.999, 10.0), (1.1, 0.999, 10.0), (1.2, 0.999, 10.0), (1.3, 0.999, 10.0), (1.4, 0.982, 10.0), (1.5, 0.99, 10.0), (1.5001, 0.0, 10.0), (1.5002, 0.0, 10.0)], 1.470458, -1.0, -1.0, 0, 66.615189, 0, 2.3, 0.0)
const LZ_BK10 = Glass(GlassID(AGF, 1662), 1, 2.42307849, -0.00901143483, 0.0123563026, 0.000933303938, -0.00010872319, 6.35375981e-6, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, 0.0, -1.0, -1.0, 7.1, -1.0, 0.0, -1.0, [(0.32, 0.155, 10.0), (0.34, 0.612, 10.0), (0.36, 0.849, 10.0), (0.38, 0.933, 10.0), (0.4, 0.978, 10.0), (0.42, 0.982, 10.0), (0.44, 0.986, 10.0), (0.44, 0.99, 10.0), (0.46, 0.992, 10.0), (0.48, 0.994, 10.0), (0.5, 0.995, 10.0), (0.52, 0.996, 10.0), (0.54, 0.996, 10.0), (0.56, 0.995, 10.0), (0.58, 0.994, 10.0), (0.6, 0.994, 10.0), (0.62, 0.993, 10.0), (0.64, 0.993, 10.0), (0.66, 0.993, 10.0), (0.68, 0.993, 10.0), (0.7, 0.993, 10.0), (0.75, 0.992, 10.0), (0.8, 0.99, 10.0), (0.9, 0.987, 10.0), (1.0, 0.986, 10.0), (1.05, 0.985, 10.0), (1.1, 0.986, 10.0), (1.2, 0.986, 10.0), (1.3, 0.986, 10.0), (1.4, 0.985, 10.0), (1.5, 0.983, 10.0), (1.5001, 0.0, 10.0), (1.5002, 0.0, 10.0)], 1.568883, -1.0, -1.0, 0, 55.848531, 0, 3.12, 0.0)
const LZ_LK7 = Glass(GlassID(AGF, 1663), 1, 2.17594904, -0.0105105286, 0.00738823894, 0.000926815589, -0.000129026566, 7.28029068e-6, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, 0.0, -1.0, -1.0, 4.4, -1.0, 0.0, -1.0, [(0.3, 0.39, 10.0), (0.32, 0.526, 10.0), (0.34, 0.83, 10.0), (0.36, 0.936, 10.0), (0.38, 0.938, 10.0), (0.4, 0.986, 10.0), (0.42, 0.978, 10.0), (0.44, 0.975, 10.0), (0.46, 0.982, 10.0), (0.48, 0.983, 10.0), (0.5, 0.986, 10.0), (0.52, 0.989, 10.0), (0.54, 0.991, 10.0), (0.56, 0.991, 10.0), (0.58, 0.991, 10.0), (0.6, 0.99, 10.0), (0.62, 0.989, 10.0), (0.64, 0.989, 10.0), (0.66, 0.989, 10.0), (0.68, 0.99, 10.0), (0.7, 0.992, 10.0), (0.75, 0.994, 10.0), (0.8, 0.996, 10.0), (0.9, 0.997, 10.0), (1.0, 0.997, 10.0), (1.05, 0.997, 10.0), (1.1, 0.997, 10.0), (1.2, 0.997, 10.0), (1.3, 0.997, 10.0), (1.4, 0.976, 10.0), (1.5, 0.994, 10.0), (1.5001, 0.0, 10.0), (1.5002, 0.0, 10.0)], 1.48286, -1.0, -1.0, 0, 66.017997, 0, 2.3, 0.0)
const LZ_KF6 = Glass(GlassID(AGF, 1664), 1, 2.22150549, -0.00915658236, 0.00968676984, 0.000900839913, -0.000111722492, 6.5783197e-6, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, -0.0002, -1.0, -1.0, 6.8, -1.0, 0.0, -1.0, [(0.3, 0.17, 10.0), (0.32, 0.555, 10.0), (0.34, 0.903, 10.0), (0.36, 0.976, 10.0), (0.38, 0.978, 10.0), (0.4, 0.993, 10.0), (0.42, 0.99, 10.0), (0.44, 0.989, 10.0), (0.46, 0.991, 10.0), (0.48, 0.992, 10.0), (0.5, 0.994, 10.0), (0.52, 0.995, 10.0), (0.54, 0.995, 10.0), (0.56, 0.995, 10.0), (0.58, 0.994, 10.0), (0.6, 0.993, 10.0), (0.62, 0.992, 10.0), (0.64, 0.991, 10.0), (0.66, 0.991, 10.0), (0.68, 0.992, 10.0), (0.7, 0.992, 10.0), (0.75, 0.992, 10.0), (0.8, 0.991, 10.0), (0.9, 0.987, 10.0), (1.0, 0.984, 10.0), (1.05, 0.984, 10.0), (1.1, 0.984, 10.0), (1.10001, 1.0e-6, 10.0)], 1.50057, -1.0, -1.0, 0, 56.963856, 0, 2.52, 0.0)
const LZ_TK17 = Glass(GlassID(AGF, 1665), 1, 2.61006508, -0.0114126401, 0.0129266114, 0.00115533766, -0.000144652472, 8.27877187e-6, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, 0.0002, -1.0, -1.0, 7.6, -1.0, 0.0, -1.0, [(0.3, 1.0e-6, 10.0), (0.32, 1.0e-6, 10.0), (0.34, 1.0e-6, 10.0), (0.36, 1.0e-6, 10.0), (0.38, 0.932, 10.0), (0.4, 0.966, 10.0), (0.42, 0.982, 10.0), (0.44, 0.986, 10.0), (0.46, 0.989, 10.0), (0.48, 0.992, 10.0), (0.5, 0.994, 10.0), (0.52, 0.996, 10.0), (0.54, 0.997, 10.0), (0.56, 0.997, 10.0), (0.58, 0.996, 10.0), (0.6, 0.995, 10.0), (0.62, 0.994, 10.0), (0.64, 0.994, 10.0), (0.66, 0.994, 10.0), (0.68, 0.995, 10.0), (0.7, 0.995, 10.0), (0.75, 0.996, 10.0), (0.8, 0.995, 10.0), (0.9, 0.994, 10.0), (1.0, 0.994, 10.0), (1.05, 0.994, 10.0), (1.1, 0.994, 10.0), (1.2, 0.994, 10.0), (1.3, 0.994, 10.0), (1.4, 0.993, 10.0), (1.5, 0.992, 10.0), (1.5, 1.0e-6, 10.0)], 1.627983, -1.0, -1.0, 0, 59.126204, 0, 3.66, 0.0)
const LZ_CTK9 = Glass(GlassID(AGF, 1666), 1, 2.97705454, -0.0155247779, 0.0176170009, 0.00237738072, -0.000312943932, 1.80886898e-5, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, -0.0098, -1.0, -1.0, 5.7, -1.0, 0.0, -1.0, [(0.3, 1.0e-6, 10.0), (0.32, 0.043, 10.0), (0.34, 0.218, 10.0), (0.36, 0.561, 10.0), (0.38, 0.797, 10.0), (0.4, 0.911, 10.0), (0.42, 0.953, 10.0), (0.44, 0.968, 10.0), (0.46, 0.977, 10.0), (0.48, 0.983, 10.0), (0.5, 0.989, 10.0), (0.52, 0.991, 10.0), (0.54, 0.994, 10.0), (0.56, 0.994, 10.0), (0.58, 0.992, 10.0), (0.6, 0.992, 10.0), (0.62, 0.992, 10.0), (0.64, 0.993, 10.0), (0.66, 0.993, 10.0), (0.68, 0.993, 10.0), (0.7, 0.992, 10.0), (0.75, 0.993, 10.0), (0.8, 0.993, 10.0), (0.9, 0.996, 10.0), (1.0, 0.996, 10.0), (1.05, 0.995, 10.0), (1.1, 0.995, 10.0), (1.2, 0.995, 10.0), (1.3, 0.995, 10.0), (1.4, 0.993, 10.0), (1.5, 0.991, 10.0), (1.5, 1.0e-6, 10.0)], 1.74251, -1.0, -1.0, 0, 49.951318, 0, 4.11, 0.0)
const LZ_CTK12 = Glass(GlassID(AGF, 1667), 1, 2.81377959, -0.0150907921, 0.0159416742, 0.00135673219, -0.000160742037, 9.00882071e-6, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, -0.0076, -1.0, -1.0, 6.7, -1.0, 0.0, -1.0, [(0.3, 0.063, 10.0), (0.32, 0.24, 10.0), (0.34, 0.574, 10.0), (0.36, 0.799, 10.0), (0.38, 0.906, 10.0), (0.4, 0.975, 10.0), (0.42, 0.983, 10.0), (0.44, 0.985, 10.0), (0.46, 0.99, 10.0), (0.48, 0.993, 10.0), (0.5, 0.996, 10.0), (0.52, 0.996, 10.0), (0.54, 0.997, 10.0), (0.56, 0.996, 10.0), (0.58, 0.993, 10.0), (0.6, 0.995, 10.0), (0.62, 0.995, 10.0), (0.64, 0.994, 10.0), (0.66, 0.995, 10.0), (0.68, 0.996, 10.0), (0.7, 0.997, 10.0), (0.75, 0.995, 10.0), (0.8, 0.994, 10.0), (0.9, 0.995, 10.0), (1.0, 0.995, 10.0), (1.05, 0.995, 10.0), (1.1, 0.996, 10.0), (1.2, 0.996, 10.0), (1.3, 0.997, 10.0), (1.4, 0.995, 10.0), (1.5, 0.994, 10.0), (1.5, 1.0e-6, 10.0)], 1.691998, -1.0, -1.0, 0, 54.774939, 0, 3.46, 0.0)
const LZ_F13 = Glass(GlassID(AGF, 1668), 1, 2.55629034, -0.00926674451, 0.0217634678, 0.00113064757, -6.42903226e-5, 6.86292105e-6, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, 0.0, -1.0, -1.0, 7.3, -1.0, 0.0, -1.0, [(0.3, 1.0e-6, 10.0), (0.32, 1.0e-6, 10.0), (0.34, 0.288, 10.0), (0.36, 0.72, 10.0), (0.38, 0.893, 10.0), (0.4, 0.964, 10.0), (0.42, 0.978, 10.0), (0.44, 0.983, 10.0), (0.46, 0.989, 10.0), (0.48, 0.992, 10.0), (0.5, 0.994, 10.0), (0.52, 0.995, 10.0), (0.54, 0.996, 10.0), (0.56, 0.996, 10.0), (0.58, 0.996, 10.0), (0.6, 0.996, 10.0), (0.62, 0.996, 10.0), (0.64, 0.995, 10.0), (0.66, 0.995, 10.0), (0.68, 0.996, 10.0), (0.7, 0.997, 10.0), (0.75, 0.998, 10.0), (0.8, 0.998, 10.0), (0.9, 0.998, 10.0), (1.0, 0.997, 10.0), (1.05, 0.997, 10.0), (1.1, 0.998, 10.0), (1.2, 0.997, 10.0), (1.3, 0.997, 10.0), (1.4, 0.993, 10.0), (1.5, 0.994, 10.0), (1.5, 1.0e-6, 10.0)], 1.620043, -1.0, -1.0, 0, 36.312762, 0, 3.63, 0.0)
const LZ_TBF10 = Glass(GlassID(AGF, 1669), 1, 3.1854134, -0.0138979489, 0.0336848842, 0.00215987563, -0.000168106118, 1.8527248e-5, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, 0.0041, -1.0, -1.0, 7.3, -1.0, 0.0, -1.0, [(0.3, 1.0e-6, 10.0), (0.32, 1.0e-6, 10.0), (0.34, 1.0e-6, 10.0), (0.36, 0.045, 10.0), (0.38, 0.651, 10.0), (0.4, 0.86, 10.0), (0.42, 0.93, 10.0), (0.44, 0.95, 10.0), (0.46, 0.963, 10.0), (0.48, 0.973, 10.0), (0.5, 0.981, 10.0), (0.52, 0.987, 10.0), (0.54, 0.991, 10.0), (0.56, 0.993, 10.0), (0.58, 0.995, 10.0), (0.6, 0.996, 10.0), (0.62, 0.997, 10.0), (0.64, 0.997, 10.0), (0.66, 0.997, 10.0), (0.68, 0.998, 10.0), (0.7, 0.998, 10.0), (0.75, 0.999, 10.0), (0.8, 0.999, 10.0), (0.9, 0.999, 10.0), (1.0, 0.999, 10.0), (1.05, 0.999, 10.0), (1.1, 0.999, 10.0), (1.2, 0.999, 10.0), (1.3, 0.999, 10.0), (1.4, 0.999, 10.0), (1.5, 0.999, 10.0), (1.5, 1.0e-6, 10.0)], 1.814808, -1.0, -1.0, 0, 33.388238, 0, 4.22, 0.0)
const LZ_OK4 = Glass(GlassID(AGF, 1670), 1, 2.0797374, -0.00704003138, 0.00540675811, 0.0002583762, -1.47913069e-5, 3.13686043e-7, 0.0, 0.0, NaN, NaN, 0.365, 0.70652, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, 0.0496, -1.0, -1.0, 14.7, -1.0, 0.0, -1.0, [(0.3, 0.217, 10.0), (0.32, 0.636, 10.0), (0.34, 0.898, 10.0), (0.36, 0.985, 10.0), (0.38, 0.996, 10.0), (0.4, 0.997, 10.0), (0.42, 0.997, 10.0), (0.44, 0.997, 10.0), (0.46, 0.997, 10.0), (0.48, 0.998, 10.0), (0.5, 0.998, 10.0), (0.52, 0.998, 10.0), (0.54, 0.998, 10.0), (0.56, 0.998, 10.0), (0.58, 0.998, 10.0), (0.6, 0.998, 10.0), (0.62, 0.997, 10.0), (0.64, 0.997, 10.0), (0.66, 0.997, 10.0), (0.68, 0.996, 10.0), (0.7, 0.996, 10.0), (0.75, 0.995, 10.0), (0.8, 0.995, 10.0), (0.9, 0.995, 10.0), (1.0, 0.996, 10.0), (1.05, 0.996, 10.0), (1.1, 0.996, 10.0), (1.10001, 1.0e-6, 10.0)], 1.447342, -1.0, -1.0, 0, 92.01104, 0, 3.54, 0.0)
const LZ_BF1 = Glass(GlassID(AGF, 1671), 1, 2.29204125, -0.00969577254, 0.00993599131, 0.00129959077, -0.000170602096, 1.01977907e-5, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, -0.0005, -1.0, -1.0, 7.2, -1.0, 0.0, -1.0, [(0.3, 1.0e-6, 10.0), (0.32, 1.0e-6, 10.0), (0.34, 1.0e-6, 10.0), (0.36, 0.964, 10.0), (0.38, 0.976, 10.0), (0.4, 0.992, 10.0), (0.42, 0.992, 10.0), (0.44, 0.992, 10.0), (0.46, 0.994, 10.0), (0.48, 0.994, 10.0), (0.5, 0.994, 10.0), (0.52, 0.995, 10.0), (0.54, 0.995, 10.0), (0.56, 0.995, 10.0), (0.58, 0.995, 10.0), (0.6, 0.994, 10.0), (0.62, 0.993, 10.0), (0.64, 0.993, 10.0), (0.66, 0.994, 10.0), (0.68, 0.994, 10.0), (0.7, 0.995, 10.0), (0.75, 0.995, 10.0), (0.8, 0.995, 10.0), (0.9, 0.994, 10.0), (1.0, 0.993, 10.0), (1.05, 0.993, 10.0), (1.1, 0.993, 10.0), (1.2, 0.993, 10.0), (1.3, 0.993, 10.0), (1.4, 0.987, 10.0), (1.5, 0.992, 10.0), (1.5, 1.0e-6, 10.0)], 1.524779, -1.0, -1.0, 0, 54.678186, 0, 2.67, 0.0)
const LZ_BF7 = Glass(GlassID(AGF, 1672), 1, 2.45333363, -0.00901476781, 0.0140101066, 0.000646259728, -5.55612527e-5, 3.50414686e-6, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, 0.0002, -1.0, -1.0, 6.0, -1.0, 0.0, -1.0, [(0.3, 1.0e-6, 10.0), (0.32, 0.1, 10.0), (0.34, 0.45, 10.0), (0.36, 0.842, 10.0), (0.38, 0.944, 10.0), (0.4, 0.981, 10.0), (0.42, 0.986, 10.0), (0.44, 0.988, 10.0), (0.46, 0.991, 10.0), (0.48, 0.993, 10.0), (0.5, 0.994, 10.0), (0.52, 0.995, 10.0), (0.54, 0.995, 10.0), (0.56, 0.996, 10.0), (0.58, 0.995, 10.0), (0.6, 0.994, 10.0), (0.62, 0.998, 10.0), (0.64, 0.994, 10.0), (0.66, 0.994, 10.0), (0.68, 0.995, 10.0), (0.7, 0.995, 10.0), (0.75, 0.995, 10.0), (0.8, 0.995, 10.0), (0.9, 0.993, 10.0), (1.0, 0.992, 10.0), (1.05, 0.992, 10.0), (1.1, 0.992, 10.0), (1.2, 0.992, 10.0), (1.3, 0.992, 10.0), (1.4, 0.991, 10.0), (1.5, 0.99, 10.0), (1.5, 1.0e-6, 10.0)], 1.579596, -1.0, -1.0, 0, 53.767545, 0, 2.51, 0.0)
const LZ_LF5 = Glass(GlassID(AGF, 1673), 1, 2.4276347, -0.0091085506, 0.0165424679, 0.00126121546, -0.000121377375, 8.86788353e-6, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, -0.0007, -1.0, -1.0, 7.2, -1.0, 0.0, -1.0, [(0.3, 1.0e-6, 10.0), (0.32, 0.04, 10.0), (0.34, 0.639, 10.0), (0.36, 0.907, 10.0), (0.38, 0.951, 10.0), (0.4, 0.987, 10.0), (0.42, 0.989, 10.0), (0.44, 0.989, 10.0), (0.46, 0.992, 10.0), (0.48, 0.992, 10.0), (0.5, 0.994, 10.0), (0.52, 0.995, 10.0), (0.54, 0.995, 10.0), (0.56, 0.995, 10.0), (0.58, 0.995, 10.0), (0.6, 0.995, 10.0), (0.62, 0.994, 10.0), (0.64, 0.993, 10.0), (0.66, 0.994, 10.0), (0.68, 0.995, 10.0), (0.7, 0.996, 10.0), (0.75, 0.997, 10.0), (0.8, 0.998, 10.0), (0.9, 0.997, 10.0), (1.0, 0.997, 10.0), (1.05, 0.997, 10.0), (1.1, 0.997, 10.0), (1.2, 0.997, 10.0), (1.3, 0.997, 10.0), (1.4, 0.995, 10.0), (1.5, 0.995, 10.0), (1.5, 1.0e-5, 10.0)], 1.575012, -1.0, -1.0, 0, 41.191712, 0, 3.23, 0.0)
const LZ_BF21 = Glass(GlassID(AGF, 1674), 1, 2.51357127, -0.00129528868, 0.051708665, -0.0117206736, 0.00201803154, -0.000112017691, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, -0.0001, -1.0, -1.0, 7.7, -1.0, 0.0, -1.0, [(0.3, 1.0e-6, 10.0), (0.32, 1.0e-6, 10.0), (0.34, 0.299, 10.0), (0.36, 0.769, 10.0), (0.38, 0.918, 10.0), (0.4, 0.964, 10.0), (0.42, 0.978, 10.0), (0.44, 0.983, 10.0), (0.46, 0.989, 10.0), (0.48, 0.991, 10.0), (0.5, 0.993, 10.0), (0.52, 0.995, 10.0), (0.54, 0.996, 10.0), (0.56, 0.996, 10.0), (0.58, 0.996, 10.0), (0.6, 0.995, 10.0), (0.62, 0.994, 10.0), (0.64, 0.994, 10.0), (0.66, 0.994, 10.0), (0.68, 0.995, 10.0), (0.7, 0.996, 10.0), (0.75, 0.997, 10.0), (0.8, 0.996, 10.0), (0.9, 0.995, 10.0), (1.0, 0.995, 10.0), (1.05, 0.995, 10.0), (1.1, 0.995, 10.0), (1.2, 0.995, 10.0), (1.2, 1.0e-6, 10.0)], 1.614225, -1.0, -1.0, 0, 42.002443, 0, 3.56, 0.0)
const LZ_CTK19 = Glass(GlassID(AGF, 1675), 1, 2.98131778, -0.0153512367, 0.0189979366, 0.00189417121, -0.000249275601, 1.55448991e-5, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, -0.0094, -1.0, -1.0, 5.9, -1.0, 0.0, -1.0, [(0.3, 0.04, 10.0), (0.32, 0.177, 10.0), (0.34, 0.49, 10.0), (0.36, 0.764, 10.0), (0.38, 0.902, 10.0), (0.4, 0.954, 10.0), (0.42, 0.967, 10.0), (0.44, 0.973, 10.0), (0.46, 0.979, 10.0), (0.48, 0.986, 10.0), (0.5, 0.991, 10.0), (0.52, 0.993, 10.0), (0.54, 0.995, 10.0), (0.56, 0.996, 10.0), (0.58, 0.995, 10.0), (0.6, 0.996, 10.0), (0.62, 0.996, 10.0), (0.64, 0.996, 10.0), (0.66, 0.996, 10.0), (0.68, 0.996, 10.0), (0.7, 0.996, 10.0), (0.75, 0.996, 10.0), (0.8, 0.996, 10.0), (0.9, 0.997, 10.0), (1.0, 0.998, 10.0), (1.05, 0.998, 10.0), (1.1, 0.999, 10.0), (1.2, 0.999, 10.0), (1.3, 0.999, 10.0), (1.4, 0.999, 10.0), (1.5, 0.998, 10.0), (1.5, 1.0e-6, 10.0)], 1.744126, -1.0, -1.0, 0, 50.259344, 0, 4.09, 0.0)
const LZ_BF25 = Glass(GlassID(AGF, 1676), 1, 2.53166932, -0.00863383325, 0.0175227595, 0.000741785351, -4.9773669e-5, 4.16332303e-6, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, -0.001, -1.0, -1.0, 7.3, -1.0, 0.0, -1.0, [(0.3, 1.0e-6, 10.0), (0.32, 1.0e-6, 10.0), (0.34, 0.302, 10.0), (0.36, 0.715, 10.0), (0.38, 0.873, 10.0), (0.4, 0.955, 10.0), (0.42, 0.974, 10.0), (0.44, 0.979, 10.0), (0.46, 0.985, 10.0), (0.48, 0.99, 10.0), (0.5, 0.992, 10.0), (0.52, 0.994, 10.0), (0.54, 0.995, 10.0), (0.56, 0.995, 10.0), (0.58, 0.995, 10.0), (0.6, 0.994, 10.0), (0.62, 0.992, 10.0), (0.64, 0.991, 10.0), (0.66, 0.991, 10.0), (0.68, 0.991, 10.0), (0.7, 0.991, 10.0), (0.75, 0.991, 10.0), (0.8, 0.989, 10.0), (0.9, 0.986, 10.0), (1.0, 0.985, 10.0), (1.05, 0.985, 10.0), (1.1, 0.984, 10.0), (1.2, 0.985, 10.0), (1.3, 0.986, 10.0), (1.4, 0.985, 10.0), (1.5, 0.985, 10.0), (1.5, 1.0e-6, 10.0)], 1.607717, -1.0, -1.0, 0, 46.066745, 0, 3.47, 0.0)
const LZ_F6 = Glass(GlassID(AGF, 1677), 1, 2.5081748, -0.00926664366, 0.0193963679, 0.00135341288, -0.000115340433, 9.24894161e-6, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, -0.0015, -1.0, -1.0, 7.4, -1.0, 0.0, -1.0, [(0.3, 1.0e-6, 10.0), (0.32, 1.0e-6, 10.0), (0.34, 1.0e-6, 10.0), (0.36, 1.0e-6, 10.0), (0.38, 1.0e-6, 10.0), (0.4, 0.979, 10.0), (0.42, 0.984, 10.0), (0.44, 0.985, 10.0), (0.46, 0.989, 10.0), (0.48, 0.991, 10.0), (0.5, 0.993, 10.0), (0.52, 0.994, 10.0), (0.54, 0.995, 10.0), (0.56, 0.995, 10.0), (0.58, 0.995, 10.0), (0.6, 0.995, 10.0), (0.62, 0.994, 10.0), (0.64, 0.993, 10.0), (0.66, 0.993, 10.0), (0.68, 0.995, 10.0), (0.7, 0.995, 10.0), (0.75, 0.997, 10.0), (0.8, 0.998, 10.0), (0.9, 0.998, 10.0), (1.0, 0.997, 10.0), (1.05, 0.998, 10.0), (1.1, 0.997, 10.0), (1.2, 0.998, 10.0), (1.3, 0.997, 10.0), (1.4, 0.992, 10.0), (1.5, 0.994, 10.0), (1.5, 1.0e-6, 10.0)], 1.603235, -1.0, -1.0, 0, 37.870876, 0, 3.48, 0.0)
const LZ_K8 = Glass(GlassID(AGF, 1678), 1, 2.27195305, -0.0105662556, 0.00931690897, 0.000684822441, -8.17556553e-5, 4.49506989e-6, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, 0.0, -1.0, -1.0, 7.6, -1.0, 0.0, -1.0, [(0.3, 0.047, 10.0), (0.32, 0.501, 10.0), (0.34, 0.85, 10.0), (0.36, 0.967, 10.0), (0.38, 0.975, 10.0), (0.4, 0.992, 10.0), (0.42, 0.991, 10.0), (0.44, 0.99, 10.0), (0.46, 0.992, 10.0), (0.48, 0.993, 10.0), (0.5, 0.994, 10.0), (0.52, 0.995, 10.0), (0.54, 0.996, 10.0), (0.56, 0.996, 10.0), (0.58, 0.995, 10.0), (0.6, 0.994, 10.0), (0.62, 0.993, 10.0), (0.64, 0.992, 10.0), (0.66, 0.993, 10.0), (0.68, 0.994, 10.0), (0.7, 0.995, 10.0), (0.75, 0.995, 10.0), (0.8, 0.995, 10.0), (0.9, 0.994, 10.0), (1.0, 0.993, 10.0), (1.05, 0.993, 10.0), (1.1, 0.993, 10.0), (1.2, 0.993, 10.0), (1.3, 0.992, 10.0), (1.4, 0.967, 10.0), (1.5, 0.987, 10.0), (1.5001, 0.0, 10.0), (1.5002, 0.0, 10.0)], 1.516367, -1.0, -1.0, 0, 63.840333, 0, 2.52, 0.0)
const LZ_TK20 = Glass(GlassID(AGF, 1679), 1, 2.58703391, -0.00966130656, 0.0149652848, 0.000633005258, -5.93845183e-5, 3.64506914e-6, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, -0.0003, -1.0, -1.0, 7.3, -1.0, 0.0, -1.0, [(0.3, 1.0e-6, 10.0), (0.32, 0.023, 10.0), (0.34, 0.334, 10.0), (0.36, 0.748, 10.0), (0.38, 0.904, 10.0), (0.4, 0.968, 10.0), (0.42, 0.986, 10.0), (0.44, 0.989, 10.0), (0.46, 0.991, 10.0), (0.48, 0.994, 10.0), (0.5, 0.995, 10.0), (0.52, 0.996, 10.0), (0.54, 0.996, 10.0), (0.56, 0.996, 10.0), (0.58, 0.995, 10.0), (0.6, 0.995, 10.0), (0.62, 0.994, 10.0), (0.64, 0.994, 10.0), (0.66, 0.994, 10.0), (0.68, 0.994, 10.0), (0.7, 0.994, 10.0), (0.75, 0.993, 10.0), (0.8, 0.992, 10.0), (0.9, 0.989, 10.0), (1.0, 0.989, 10.0), (1.05, 0.989, 10.0), (1.1, 0.989, 10.0), (1.10001, 1.0e-6, 10.0)], 1.622089, -1.0, -1.0, 0, 56.631769, 0, 3.58, 0.0)
const LZ_TF4 = Glass(GlassID(AGF, 1680), 1, 2.91369613, -0.00939085434, 0.0355149621, 0.0017804574, -5.97294485e-5, 1.23859718e-5, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, 0.0044, -1.0, -1.0, 8.2, -1.0, 0.0, -1.0, [(0.3, 1.0e-6, 10.0), (0.32, 1.0e-6, 10.0), (0.34, 1.0e-6, 10.0), (0.36, 0.09, 10.0), (0.38, 0.507, 10.0), (0.4, 0.822, 10.0), (0.42, 0.921, 10.0), (0.44, 0.962, 10.0), (0.46, 0.979, 10.0), (0.48, 0.988, 10.0), (0.5, 0.991, 10.0), (0.52, 0.994, 10.0), (0.54, 0.996, 10.0), (0.56, 0.996, 10.0), (0.58, 0.996, 10.0), (0.6, 0.995, 10.0), (0.62, 0.994, 10.0), (0.64, 0.993, 10.0), (0.66, 0.994, 10.0), (0.68, 0.994, 10.0), (0.7, 0.995, 10.0), (0.75, 0.997, 10.0), (0.8, 0.997, 10.0), (0.9, 0.997, 10.0), (1.0, 0.997, 10.0), (1.05, 0.997, 10.0), (1.1, 0.997, 10.0), (1.2, 0.998, 10.0), (1.3, 0.998, 10.0), (1.4, 0.996, 10.0), (1.5, 0.996, 10.0), (1.5, 1.0e-6, 10.0)], 1.740025, -1.0, -1.0, 0, 28.155393, 0, 4.65, 0.0)
const LZ_F4 = Glass(GlassID(AGF, 1681), 1, 2.56910165, -0.00921235766, 0.021753783, 0.00135425186, -9.9920825e-5, 9.17282594e-6, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, -0.0006, -1.0, -1.0, 7.6, -1.0, 0.0, -1.0, [(0.3, 1.0e-6, 10.0), (0.32, 1.0e-6, 10.0), (0.34, 1.0e-6, 10.0), (0.36, 1.0e-6, 10.0), (0.38, 0.89, 10.0), (0.4, 0.962, 10.0), (0.42, 0.971, 10.0), (0.44, 0.98, 10.0), (0.46, 0.986, 10.0), (0.48, 0.989, 10.0), (0.5, 0.992, 10.0), (0.52, 0.994, 10.0), (0.54, 0.995, 10.0), (0.56, 0.995, 10.0), (0.58, 0.995, 10.0), (0.6, 0.994, 10.0), (0.62, 0.993, 10.0), (0.64, 0.992, 10.0), (0.66, 0.992, 10.0), (0.68, 0.994, 10.0), (0.7, 0.995, 10.0), (0.75, 0.997, 10.0), (0.8, 0.998, 10.0), (0.9, 0.998, 10.0), (1.0, 0.998, 10.0), (1.05, 0.998, 10.0), (1.1, 0.997, 10.0), (1.1, 1.0e-6, 10.0)], 1.62435, -1.0, -1.0, 0, 35.893835, 0, 3.67, 0.0)
const LZ_BF28 = Glass(GlassID(AGF, 1682), 1, 2.69158831, -0.00926805586, 0.025246966, 0.00104303726, -3.80279398e-5, 6.40273561e-6, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, 0.0007, -1.0, -1.0, 6.5, -1.0, 0.0, -1.0, [(0.3, 1.0e-6, 10.0), (0.32, 1.0e-6, 10.0), (0.34, 1.0e-6, 10.0), (0.36, 1.0e-6, 10.0), (0.38, 0.8, 10.0), (0.4, 0.899, 10.0), (0.42, 0.954, 10.0), (0.44, 0.973, 10.0), (0.46, 0.984, 10.0), (0.48, 0.99, 10.0), (0.5, 0.993, 10.0), (0.52, 0.995, 10.0), (0.54, 0.996, 10.0), (0.56, 0.996, 10.0), (0.58, 0.996, 10.0), (0.6, 0.995, 10.0), (0.62, 0.994, 10.0), (0.64, 0.993, 10.0), (0.66, 0.994, 10.0), (0.68, 0.995, 10.0), (0.7, 0.995, 10.0), (0.75, 0.996, 10.0), (0.8, 0.995, 10.0), (0.9, 0.994, 10.0), (1.0, 0.993, 10.0), (1.05, 0.994, 10.0), (1.1, 0.994, 10.0), (1.2, 0.994, 10.0), (1.3, 0.995, 10.0), (1.4, 0.992, 10.0), (1.5, 0.992, 10.0), (1.5, 1.0e-6, 10.0)], 1.664271, -1.0, -1.0, 0, 35.443451, 0, 3.96, 0.0)
const LZ_TK9 = Glass(GlassID(AGF, 1683), 1, 2.57082062, -0.00937761655, 0.0128028917, 0.00196440138, -0.000293263324, 1.77969401e-5, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, -0.0007, -1.0, -1.0, 7.6, -1.0, 0.0, -1.0, [(0.3, 1.0e-6, 10.0), (0.32, 1.0e-6, 10.0), (0.34, 1.0e-6, 10.0), (0.36, 1.0e-6, 10.0), (0.38, 0.908, 10.0), (0.4, 0.958, 10.0), (0.42, 0.976, 10.0), (0.44, 0.981, 10.0), (0.46, 0.986, 10.0), (0.48, 0.99, 10.0), (0.5, 0.993, 10.0), (0.52, 0.995, 10.0), (0.54, 0.996, 10.0), (0.56, 0.996, 10.0), (0.58, 0.995, 10.0), (0.6, 0.995, 10.0), (0.62, 0.993, 10.0), (0.64, 0.993, 10.0), (0.66, 0.993, 10.0), (0.68, 0.993, 10.0), (0.7, 0.993, 10.0), (0.75, 0.992, 10.0), (0.8, 0.991, 10.0), (0.9, 0.988, 10.0), (1.0, 0.987, 10.0), (1.05, 0.987, 10.0), (1.1, 0.987, 10.0), (1.10001, 1.0e-6, 10.0)], 1.617182, -1.0, -1.0, 0, 53.314487, 0, 3.62, 0.0)
const LZ_TK21 = Glass(GlassID(AGF, 1684), 1, 2.69129136, -0.00883561149, 0.0180045931, 0.000716414509, -5.4688791e-5, 3.7462472e-6, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, -0.0008, -1.0, -1.0, 8.1, -1.0, 0.0, -1.0, [(0.3, 1.0e-6, 10.0), (0.32, 1.0e-6, 10.0), (0.34, 1.0e-6, 10.0), (0.36, 1.0e-6, 10.0), (0.38, 0.887, 10.0), (0.4, 0.939, 10.0), (0.42, 0.967, 10.0), (0.44, 0.971, 10.0), (0.46, 0.976, 10.0), (0.48, 0.983, 10.0), (0.5, 0.989, 10.0), (0.52, 0.993, 10.0), (0.54, 0.995, 10.0), (0.56, 0.996, 10.0), (0.58, 0.996, 10.0), (0.6, 0.995, 10.0), (0.62, 0.994, 10.0), (0.64, 0.993, 10.0), (0.66, 0.993, 10.0), (0.68, 0.994, 10.0), (0.7, 0.994, 10.0), (0.75, 0.994, 10.0), (0.8, 0.993, 10.0), (0.9, 0.992, 10.0), (1.0, 0.991, 10.0), (1.05, 0.991, 10.0), (1.1, 0.991, 10.0), (1.2, 0.992, 10.0), (1.3, 0.993, 10.0), (1.4, 0.99, 10.0), (1.5, 0.992, 10.0), (1.5, 1.0e-6, 10.0)], 1.656907, -1.0, -1.0, 0, 51.062107, 0, 3.98, 0.0)
const LZ_KF7 = Glass(GlassID(AGF, 1685), 1, 2.2676046, -0.00960405204, 0.0112639638, 0.00101025094, -0.000117978187, 7.84675481e-6, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, 0.001, -1.0, -1.0, 6.0, -1.0, 0.0, -1.0, [(0.3, 1.0e-6, 10.0), (0.32, 1.0e-6, 10.0), (0.34, 1.0e-6, 10.0), (0.36, 1.0e-6, 10.0), (0.38, 0.855, 10.0), (0.4, 0.967, 10.0), (0.42, 0.978, 10.0), (0.44, 0.98, 10.0), (0.46, 0.985, 10.0), (0.48, 0.985, 10.0), (0.5, 0.987, 10.0), (0.52, 0.988, 10.0), (0.54, 0.989, 10.0), (0.56, 0.989, 10.0), (0.58, 0.988, 10.0), (0.6, 0.987, 10.0), (0.62, 0.985, 10.0), (0.64, 0.983, 10.0), (0.66, 0.984, 10.0), (0.68, 0.988, 10.0), (0.7, 0.991, 10.0), (0.75, 0.995, 10.0), (0.8, 0.996, 10.0), (0.9, 0.995, 10.0), (1.0, 0.994, 10.0), (1.05, 0.994, 10.0), (1.1, 0.994, 10.0), (1.2, 0.994, 10.0), (1.3, 0.995, 10.0), (1.4, 0.992, 10.0), (1.5, 0.992, 10.0), (1.5, 1.0e-6, 10.0)], 1.51759, -1.0, -1.0, 0, 50.999231, 0, 2.51, 0.0)
const LZ_TF8 = Glass(GlassID(AGF, 1686), 1, 2.76048757, -0.00937618097, 0.0300701363, 0.00118690238, -1.70367903e-5, 6.94635155e-6, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, 0.0014, -1.0, -1.0, 8.1, -1.0, 0.0, -1.0, [(0.3, 1.0e-6, 10.0), (0.32, 1.0e-6, 10.0), (0.34, 1.0e-6, 10.0), (0.36, 1.0e-6, 10.0), (0.38, 0.841, 10.0), (0.4, 0.917, 10.0), (0.42, 0.959, 10.0), (0.44, 0.973, 10.0), (0.46, 0.982, 10.0), (0.48, 0.988, 10.0), (0.5, 0.988, 10.0), (0.52, 0.994, 10.0), (0.54, 0.996, 10.0), (0.56, 0.996, 10.0), (0.58, 0.995, 10.0), (0.6, 0.994, 10.0), (0.62, 0.993, 10.0), (0.64, 0.992, 10.0), (0.66, 0.992, 10.0), (0.68, 0.994, 10.0), (0.7, 0.994, 10.0), (0.75, 0.996, 10.0), (0.8, 0.996, 10.0), (0.9, 0.996, 10.0), (1.0, 0.995, 10.0), (1.05, 0.995, 10.0), (1.1, 0.995, 10.0), (1.2, 0.995, 10.0), (1.3, 0.995, 10.0), (1.4, 0.993, 10.0), (1.5, 0.993, 10.0), (1.5, 1.0e-6, 10.0)], 1.689493, -1.0, -1.0, 0, 31.129886, 0, 4.23, 0.0)
const LZ_BK8 = Glass(GlassID(AGF, 1687), 1, 2.3626929, -0.0108658239, 0.00927841163, 0.00119101528, -0.000163068347, 9.29084884e-6, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, 0.0005, -1.0, -1.0, 6.2, -1.0, 0.0, -1.0, [(0.36, 0.916, 10.0), (0.38, 0.96, 10.0), (0.4, 0.986, 10.0), (0.42, 0.987, 10.0), (0.44, 0.987, 10.0), (0.46, 0.99, 10.0), (0.48, 0.994, 10.0), (0.5, 0.994, 10.0), (0.52, 0.995, 10.0), (0.54, 0.995, 10.0), (0.56, 0.995, 10.0), (0.58, 0.995, 10.0), (0.6, 0.994, 10.0), (0.62, 0.994, 10.0), (0.64, 0.994, 10.0), (0.66, 0.994, 10.0), (0.68, 0.995, 10.0), (0.7, 0.995, 10.0), (0.75, 0.995, 10.0), (0.8, 0.995, 10.0), (0.9, 0.994, 10.0), (1.0, 0.994, 10.0), (1.05, 0.994, 10.0), (1.1, 0.994, 10.0), (1.2, 0.994, 10.0), (1.3, 0.994, 10.0), (1.4, 0.974, 10.0), (1.5, 0.989, 10.0), (1.5001, 0.0, 10.0), (1.5002, 0.0, 10.0)], 1.546771, -1.0, -1.0, 0, 62.415319, 0, 2.83, 0.0)
const LZ_CTK3 = Glass(GlassID(AGF, 1688), 1, 2.70824988, -0.0115853419, 0.0148353494, 0.00113661318, -0.000141122975, 8.3706103e-6, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, -0.0021, -1.0, -1.0, 7.0, -1.0, 0.0, -1.0, [(0.3, 1.0e-6, 10.0), (0.32, 1.0e-6, 10.0), (0.34, 1.0e-6, 10.0), (0.36, 0.903, 10.0), (0.38, 0.942, 10.0), (0.4, 0.967, 10.0), (0.42, 0.977, 10.0), (0.44, 0.979, 10.0), (0.46, 0.984, 10.0), (0.48, 0.987, 10.0), (0.5, 0.992, 10.0), (0.52, 0.994, 10.0), (0.54, 0.996, 10.0), (0.56, 0.996, 10.0), (0.58, 0.996, 10.0), (0.6, 0.996, 10.0), (0.62, 0.996, 10.0), (0.64, 0.995, 10.0), (0.66, 0.995, 10.0), (0.68, 0.995, 10.0), (0.7, 0.995, 10.0), (0.75, 0.995, 10.0), (0.8, 0.995, 10.0), (0.9, 0.995, 10.0), (1.0, 0.994, 10.0), (1.05, 0.994, 10.0), (1.1, 0.994, 10.0), (1.2, 0.993, 10.0), (1.3, 0.993, 10.0), (1.4, 0.983, 10.0), (1.5, 0.989, 10.0), (1.5, 1.0e-6, 10.0)], 1.659494, -1.0, -1.0, 0, 57.197863, 0, 3.91, 0.0)
const LZ_F1 = Glass(GlassID(AGF, 1689), 1, 2.53587365, -0.00924623241, 0.0206589134, 0.001286665, -9.64243985e-5, 8.49321925e-6, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, -0.0007, -1.0, -1.0, 7.4, -1.0, 0.0, -1.0, [(0.3, 1.0e-6, 10.0), (0.32, 1.0e-6, 10.0), (0.34, 0.376, 10.0), (0.36, 0.81, 10.0), (0.38, 0.917, 10.0), (0.4, 0.977, 10.0), (0.42, 0.984, 10.0), (0.44, 0.986, 10.0), (0.46, 0.989, 10.0), (0.48, 0.991, 10.0), (0.5, 0.993, 10.0), (0.52, 0.995, 10.0), (0.54, 0.996, 10.0), (0.56, 0.996, 10.0), (0.58, 0.996, 10.0), (0.6, 0.995, 10.0), (0.62, 0.995, 10.0), (0.64, 0.994, 10.0), (0.66, 0.994, 10.0), (0.68, 0.995, 10.0), (0.7, 0.996, 10.0), (0.75, 0.998, 10.0), (0.8, 0.998, 10.0), (0.9, 0.998, 10.0), (1.0, 0.998, 10.0), (1.05, 0.998, 10.0), (1.1, 0.998, 10.0), (1.2, 0.998, 10.0), (1.3, 0.997, 10.0), (1.4, 0.994, 10.0), (1.5, 0.996, 10.0), (1.5, 1.0e-6, 10.0)], 1.612939, -1.0, -1.0, 0, 36.880176, 0, 3.57, 0.0)
const LZ_BK6 = Glass(GlassID(AGF, 1690), 1, 2.33808859, -0.00885971304, 0.0113124762, 0.000587150772, -5.8656147e-5, 3.32980279e-6, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, 0.0019, -1.0, -1.0, 8.2, -1.0, 0.0, -1.0, [(0.3, 0.033, 10.0), (0.32, 0.461, 10.0), (0.34, 0.854, 10.0), (0.36, 0.973, 10.0), (0.38, 0.992, 10.0), (0.4, 0.991, 10.0), (0.42, 0.991, 10.0), (0.44, 0.99, 10.0), (0.46, 0.992, 10.0), (0.48, 0.993, 10.0), (0.5, 0.994, 10.0), (0.52, 0.995, 10.0), (0.54, 0.996, 10.0), (0.56, 0.996, 10.0), (0.58, 0.995, 10.0), (0.6, 0.994, 10.0), (0.62, 0.993, 10.0), (0.64, 0.992, 10.0), (0.66, 0.992, 10.0), (0.68, 0.993, 10.0), (0.7, 0.994, 10.0), (0.75, 0.994, 10.0), (0.8, 0.993, 10.0), (0.9, 0.991, 10.0), (1.0, 0.99, 10.0), (1.05, 0.989, 10.0), (1.1, 0.989, 10.0), (1.2, 0.989, 10.0), (1.3, 0.989, 10.0), (1.4, 0.985, 10.0), (1.5, 0.985, 10.0), (1.5001, 0.0, 10.0), (1.5002, 0.0, 10.0)], 1.539978, -1.0, -1.0, 0, 59.607401, 0, 2.86, 0.0)
const LZ_TF7 = Glass(GlassID(AGF, 1691), 1, 2.87556005, -0.00903892068, 0.0346318645, 0.0017867828, -8.10904694e-5, 1.38166415e-5, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, 0.0039, -1.0, -1.0, 9.6, -1.0, 0.0, -1.0, [(0.3, 1.0e-6, 10.0), (0.32, 1.0e-6, 10.0), (0.34, 1.0e-6, 10.0), (0.36, 0.247, 10.0), (0.38, 0.669, 10.0), (0.4, 0.887, 10.0), (0.42, 0.952, 10.0), (0.44, 0.972, 10.0), (0.46, 0.982, 10.0), (0.48, 0.987, 10.0), (0.5, 0.991, 10.0), (0.52, 0.994, 10.0), (0.54, 0.995, 10.0), (0.56, 0.995, 10.0), (0.58, 0.995, 10.0), (0.6, 0.994, 10.0), (0.62, 0.993, 10.0), (0.64, 0.992, 10.0), (0.66, 0.992, 10.0), (0.68, 0.993, 10.0), (0.7, 0.994, 10.0), (0.75, 0.998, 10.0), (0.8, 0.997, 10.0), (0.9, 0.997, 10.0), (1.0, 0.997, 10.0), (1.05, 0.997, 10.0), (1.1, 0.998, 10.0), (1.2, 0.998, 10.0), (1.3, 0.998, 10.0), (1.4, 0.997, 10.0), (1.5, 0.996, 10.0), (1.5, 1.0e-6, 10.0)], 1.728221, -1.0, -1.0, 0, 28.32234, 0, 4.52, 0.0)
const LZ_TF3 = Glass(GlassID(AGF, 1692), 1, 2.84582216, -0.00949073913, 0.0320009016, 0.00191185788, -0.000115848478, 1.47283242e-5, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, 0.0039, -1.0, -1.0, 8.3, -1.0, 0.0, -1.0, [(0.3, 1.0e-6, 10.0), (0.32, 1.0e-6, 10.0), (0.34, 1.0e-6, 10.0), (0.36, 0.201, 10.0), (0.38, 0.637, 10.0), (0.4, 0.866, 10.0), (0.42, 0.942, 10.0), (0.44, 0.969, 10.0), (0.46, 0.98, 10.0), (0.48, 0.987, 10.0), (0.5, 0.992, 10.0), (0.52, 0.994, 10.0), (0.54, 0.996, 10.0), (0.56, 0.996, 10.0), (0.58, 0.995, 10.0), (0.6, 0.994, 10.0), (0.62, 0.993, 10.0), (0.64, 0.993, 10.0), (0.66, 0.993, 10.0), (0.68, 0.994, 10.0), (0.7, 0.995, 10.0), (0.75, 0.997, 10.0), (0.8, 0.998, 10.0), (0.9, 0.997, 10.0), (1.0, 0.997, 10.0), (1.05, 0.997, 10.0), (1.1, 0.997, 10.0), (1.2, 0.997, 10.0), (1.3, 0.998, 10.0), (1.4, 0.996, 10.0), (1.5, 0.995, 10.0), (1.5, 1.0e-6, 10.0)], 1.717412, -1.0, -1.0, 0, 29.476681, 0, 4.46, 0.0)
const LZ_TK16 = Glass(GlassID(AGF, 1693), 1, 2.55981468, -0.0100242005, 0.0134154165, 0.000925376875, -0.000110815289, 6.50410814e-6, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, 0.0012, -1.0, -1.0, 7.3, -1.0, 0.0, -1.0, [(0.3, 2.0e-6, 10.0), (0.32, 1.0e-6, 10.0), (0.34, 0.36, 10.0), (0.36, 0.754, 10.0), (0.38, 0.912, 10.0), (0.4, 0.964, 10.0), (0.42, 0.98, 10.0), (0.44, 0.983, 10.0), (0.46, 0.987, 10.0), (0.48, 0.99, 10.0), (0.5, 0.993, 10.0), (0.52, 0.995, 10.0), (0.54, 0.996, 10.0), (0.56, 0.996, 10.0), (0.58, 0.995, 10.0), (0.6, 0.995, 10.0), (0.62, 0.994, 10.0), (0.64, 0.993, 10.0), (0.66, 0.993, 10.0), (0.68, 0.993, 10.0), (0.7, 0.993, 10.0), (0.75, 0.994, 10.0), (0.8, 0.991, 10.0), (0.9, 0.988, 10.0), (1.0, 0.986, 10.0), (1.05, 0.986, 10.0), (1.1, 0.986, 10.0), (1.2, 0.987, 10.0), (1.3, 0.988, 10.0), (1.4, 0.984, 10.0), (1.5, 0.985, 10.0), (1.5, 1.0e-6, 10.0)], 1.612682, -1.0, -1.0, 0, 58.136768, 0, 3.56, 0.0)
const LZ_BF24 = Glass(GlassID(AGF, 1694), 1, 2.60182854, -0.00907273896, 0.022136924, 0.00124712094, -8.73795036e-5, 8.50139757e-6, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, -0.0003, -1.0, -1.0, 7.9, -1.0, 0.0, -1.0, [(0.3, 1.0e-6, 10.0), (0.32, 1.0e-6, 10.0), (0.34, 0.055, 10.0), (0.36, 0.444, 10.0), (0.38, 0.743, 10.0), (0.4, 0.94, 10.0), (0.42, 0.968, 10.0), (0.44, 0.978, 10.0), (0.46, 0.985, 10.0), (0.48, 0.99, 10.0), (0.5, 0.992, 10.0), (0.52, 0.994, 10.0), (0.54, 0.995, 10.0), (0.56, 0.995, 10.0), (0.58, 0.995, 10.0), (0.6, 0.995, 10.0), (0.62, 0.994, 10.0), (0.64, 0.993, 10.0), (0.66, 0.993, 10.0), (0.68, 0.994, 10.0), (0.7, 0.994, 10.0), (0.75, 0.995, 10.0), (0.8, 0.994, 10.0), (0.9, 0.993, 10.0), (1.0, 0.993, 10.0), (1.05, 0.993, 10.0), (1.1, 0.993, 10.0), (1.1, 1.0e-6, 10.0)], 1.634551, -1.0, -1.0, 0, 36.733283, 0, 3.67, 0.0)
const LZ_LF7 = Glass(GlassID(AGF, 1695), 1, 2.43725266, -0.00906327607, 0.0172292069, 0.00107526924, -8.85381819e-5, 7.03961058e-6, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, -0.0008, -1.0, -1.0, 7.5, -1.0, 0.0, -1.0, [(0.3, 1.0e-6, 10.0), (0.32, 0.059, 10.0), (0.34, 0.699, 10.0), (0.36, 0.944, 10.0), (0.38, 0.986, 10.0), (0.4, 0.988, 10.0), (0.42, 0.99, 10.0), (0.44, 0.991, 10.0), (0.46, 0.993, 10.0), (0.48, 0.994, 10.0), (0.5, 0.994, 10.0), (0.52, 0.995, 10.0), (0.54, 0.995, 10.0), (0.56, 0.995, 10.0), (0.58, 0.995, 10.0), (0.6, 0.994, 10.0), (0.62, 0.994, 10.0), (0.64, 0.995, 10.0), (0.66, 0.996, 10.0), (0.68, 0.998, 10.0), (0.7, 0.999, 10.0), (0.75, 0.998, 10.0), (0.8, 0.998, 10.0), (0.9, 0.998, 10.0), (1.0, 0.998, 10.0), (1.05, 0.998, 10.0), (1.1, 0.998, 10.0), (1.1, 1.0e-6, 10.0)], 1.578416, -1.0, -1.0, 0, 41.04154, 0, 3.23, 0.0)
const LZ_BF8 = Glass(GlassID(AGF, 1696), 1, 2.45575926, -0.00835756809, 0.0160627256, 0.000794572904, -5.9357522e-5, 4.56440502e-6, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, 0.0014, -1.0, -1.0, 8.2, -1.0, 0.0, -1.0, [(0.3, 1.0e-6, 10.0), (0.32, 0.093, 10.0), (0.34, 0.721, 10.0), (0.36, 0.925, 10.0), (0.38, 0.962, 10.0), (0.4, 0.988, 10.0), (0.42, 0.99, 10.0), (0.44, 0.99, 10.0), (0.46, 0.992, 10.0), (0.48, 0.994, 10.0), (0.5, 0.994, 10.0), (0.52, 0.995, 10.0), (0.54, 0.995, 10.0), (0.56, 0.995, 10.0), (0.58, 0.995, 10.0), (0.6, 0.995, 10.0), (0.62, 0.995, 10.0), (0.64, 0.995, 10.0), (0.66, 0.994, 10.0), (0.68, 0.996, 10.0), (0.7, 0.996, 10.0), (0.75, 0.996, 10.0), (0.8, 0.996, 10.0), (0.9, 0.995, 10.0), (1.0, 0.994, 10.0), (1.05, 0.994, 10.0), (1.1, 0.994, 10.0), (1.2, 0.994, 10.0), (1.3, 0.994, 10.0), (1.4, 0.992, 10.0), (1.5, 0.993, 10.0), (1.5, 1.0e-6, 10.0)], 1.582703, -1.0, -1.0, 0, 46.397162, 0, 3.28, 0.0)
const LZ_TK14 = Glass(GlassID(AGF, 1697), 1, 2.56353018, -0.0112558985, 0.0129306977, 0.000811788179, -9.19927254e-5, 5.30548328e-6, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, 0.0004, -1.0, -1.0, 6.9, -1.0, 0.0, -1.0, [(0.3, 1.0e-6, 10.0), (0.32, 0.056, 10.0), (0.34, 0.406, 10.0), (0.36, 0.763, 10.0), (0.38, 0.923, 10.0), (0.4, 0.965, 10.0), (0.42, 0.98, 10.0), (0.44, 0.983, 10.0), (0.46, 0.986, 10.0), (0.48, 0.99, 10.0), (0.5, 0.996, 10.0), (0.52, 0.995, 10.0), (0.54, 0.995, 10.0), (0.56, 0.996, 10.0), (0.58, 0.995, 10.0), (0.6, 0.995, 10.0), (0.62, 0.994, 10.0), (0.64, 0.994, 10.0), (0.66, 0.994, 10.0), (0.68, 0.994, 10.0), (0.7, 0.994, 10.0), (0.75, 0.994, 10.0), (0.8, 0.993, 10.0), (0.9, 0.991, 10.0), (1.0, 0.99, 10.0), (1.05, 0.99, 10.0), (1.1, 0.99, 10.0), (1.2, 0.991, 10.0), (1.3, 0.991, 10.0), (1.4, 0.99, 10.0), (1.5, 0.99, 10.0), (1.5, 1.0e-6, 10.0)], 1.613087, -1.0, -1.0, 0, 60.435759, 0, 3.51, 0.0)
const LZ_BF11 = Glass(GlassID(AGF, 1698), 1, 2.58452612, -0.00918889928, 0.0158244594, 0.00069190774, -5.75329364e-5, 3.70190834e-6, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, 0.0004, -1.0, -1.0, 7.0, -1.0, 0.0, -1.0, [(0.3, 1.0e-6, 10.0), (0.32, 1.0e-6, 10.0), (0.34, 0.284, 10.0), (0.36, 0.708, 10.0), (0.38, 0.91, 10.0), (0.4, 0.962, 10.0), (0.42, 0.981, 10.0), (0.44, 0.986, 10.0), (0.46, 0.99, 10.0), (0.48, 0.993, 10.0), (0.5, 0.995, 10.0), (0.52, 0.996, 10.0), (0.54, 0.996, 10.0), (0.56, 0.996, 10.0), (0.58, 0.995, 10.0), (0.6, 0.995, 10.0), (0.62, 0.994, 10.0), (0.64, 0.994, 10.0), (0.66, 0.993, 10.0), (0.68, 0.993, 10.0), (0.7, 0.993, 10.0), (0.75, 0.992, 10.0), (0.8, 0.991, 10.0), (0.9, 0.988, 10.0), (1.0, 0.986, 10.0), (1.05, 0.988, 10.0), (1.1, 0.988, 10.0), (1.1, 1.0e-6, 10.0)], 1.622301, -1.0, -1.0, 0, 53.066034, 0, 3.66, 0.0)
const LZ_BK4 = Glass(GlassID(AGF, 1699), 1, 2.31024628, -0.00901307991, 0.0102533493, 0.000831871974, -0.000102626485, 5.86726499e-6, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, 0.0004, -1.0, -1.0, 8.0, -1.0, 0.0, -1.0, [(0.34, 0.896, 10.0), (0.36, 0.941, 10.0), (0.38, 0.958, 10.0), (0.4, 0.984, 10.0), (0.42, 0.985, 10.0), (0.44, 0.986, 10.0), (0.46, 0.99, 10.0), (0.48, 0.992, 10.0), (0.5, 0.994, 10.0), (0.52, 0.995, 10.0), (0.54, 0.995, 10.0), (0.56, 0.996, 10.0), (0.58, 0.995, 10.0), (0.6, 0.995, 10.0), (0.62, 0.994, 10.0), (0.64, 0.994, 10.0), (0.66, 0.994, 10.0), (0.68, 0.995, 10.0), (0.7, 0.995, 10.0), (0.75, 0.995, 10.0), (0.8, 0.995, 10.0), (0.9, 0.992, 10.0), (1.0, 0.991, 10.0), (1.05, 0.991, 10.0), (1.1, 0.991, 10.0), (1.1001, 0.0, 10.0), (1.1002, 0.0, 10.0)], 1.530272, -1.0, -1.0, 0, 60.261132, 0, 2.76, 0.0)
const LZ_TF2 = Glass(GlassID(AGF, 1700), 1, 2.71155707, -0.00931191991, 0.0266942397, 0.00168606296, -0.000115751993, 1.20753872e-5, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, 0.0012, -1.0, -1.0, 7.8, -1.0, 0.0, -1.0, [(0.3, 1.0e-6, 10.0), (0.32, 1.0e-6, 10.0), (0.34, 0.015, 10.0), (0.36, 0.4, 10.0), (0.38, 0.741, 10.0), (0.4, 0.903, 10.0), (0.42, 0.956, 10.0), (0.44, 0.973, 10.0), (0.46, 0.983, 10.0), (0.48, 0.989, 10.0), (0.5, 0.981, 10.0), (0.52, 0.994, 10.0), (0.54, 0.995, 10.0), (0.56, 0.995, 10.0), (0.58, 0.995, 10.0), (0.6, 0.995, 10.0), (0.62, 0.995, 10.0), (0.64, 0.993, 10.0), (0.66, 0.993, 10.0), (0.68, 0.994, 10.0), (0.7, 0.995, 10.0), (0.75, 0.997, 10.0), (0.8, 0.997, 10.0), (0.9, 0.996, 10.0), (1.0, 0.996, 10.0), (1.05, 0.996, 10.0), (1.1, 0.996, 10.0), (1.2, 0.996, 10.0), (1.3, 0.996, 10.0), (1.4, 0.994, 10.0), (1.5, 0.993, 10.0), (1.5, 1.0e-6, 10.0)], 1.672677, -1.0, -1.0, 0, 32.192393, 0, 4.09, 0.0)
const LZ_F8 = Glass(GlassID(AGF, 1701), 1, 2.56893067, -0.00867019014, 0.0233836541, 0.000788814438, -1.94901062e-6, 3.65751489e-6, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, 0.0002, -1.0, -1.0, 9.9, -1.0, 0.0, -1.0, [(0.3, 1.0e-6, 10.0), (0.32, 1.0e-6, 10.0), (0.34, 1.0e-6, 10.0), (0.36, 0.846, 10.0), (0.38, 0.933, 10.0), (0.4, 0.98, 10.0), (0.42, 0.985, 10.0), (0.44, 0.988, 10.0), (0.46, 0.99, 10.0), (0.48, 0.992, 10.0), (0.5, 0.993, 10.0), (0.52, 0.994, 10.0), (0.54, 0.993, 10.0), (0.56, 0.992, 10.0), (0.58, 0.992, 10.0), (0.6, 0.991, 10.0), (0.62, 0.992, 10.0), (0.64, 0.993, 10.0), (0.66, 0.994, 10.0), (0.68, 0.995, 10.0), (0.7, 0.995, 10.0), (0.75, 0.996, 10.0), (0.8, 0.996, 10.0), (0.9, 0.995, 10.0), (1.0, 0.995, 10.0), (1.05, 0.995, 10.0), (1.1, 0.994, 10.0), (1.1, 1.0e-6, 10.0)], 1.624962, -1.0, -1.0, 0, 35.616557, 0, 3.61, 0.0)
const LZ_OF1 = Glass(GlassID(AGF, 1702), 1, 2.30412369, -0.0109592456, 0.0110535035, 0.00115646445, -0.000135754887, 7.91833375e-6, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, -0.0054, -1.0, -1.0, 6.3, -1.0, 0.0, -1.0, [(0.3, 1.0e-6, 10.0), (0.32, 1.0e-6, 10.0), (0.34, 1.0e-6, 10.0), (0.36, 0.537, 10.0), (0.38, 0.805, 10.0), (0.4, 0.906, 10.0), (0.42, 0.952, 10.0), (0.44, 0.971, 10.0), (0.46, 0.983, 10.0), (0.48, 0.989, 10.0), (0.5, 0.992, 10.0), (0.52, 0.994, 10.0), (0.54, 0.995, 10.0), (0.56, 0.996, 10.0), (0.58, 0.994, 10.0), (0.6, 0.994, 10.0), (0.62, 0.994, 10.0), (0.64, 0.994, 10.0), (0.66, 0.994, 10.0), (0.68, 0.995, 10.0), (0.7, 0.996, 10.0), (0.75, 0.997, 10.0), (0.8, 0.998, 10.0), (0.9, 0.998, 10.0), (1.0, 0.998, 10.0), (1.05, 0.998, 10.0), (1.1, 0.998, 10.0), (1.00001, 1.0e-6, 10.0)], 1.529483, -1.0, -1.0, 0, 51.596468, 0, 2.56, 0.0)
const LZ_LK3 = Glass(GlassID(AGF, 1703), 1, 2.19005351, -0.00985036837, 0.0074413086, 0.000767453298, -0.000104983034, 5.99100257e-6, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, 0.0067, -1.0, -1.0, 9.2, -1.0, 0.0, -1.0, [(0.3, 0.348, 10.0), (0.32, 0.781, 10.0), (0.34, 0.925, 10.0), (0.36, 0.971, 10.0), (0.38, 0.973, 10.0), (0.4, 0.996, 10.0), (0.42, 0.994, 10.0), (0.44, 0.993, 10.0), (0.46, 0.995, 10.0), (0.48, 0.995, 10.0), (0.5, 0.994, 10.0), (0.52, 0.995, 10.0), (0.54, 0.995, 10.0), (0.56, 0.995, 10.0), (0.58, 0.995, 10.0), (0.6, 0.994, 10.0), (0.62, 0.994, 10.0), (0.64, 0.993, 10.0), (0.66, 0.995, 10.0), (0.68, 0.996, 10.0), (0.7, 0.998, 10.0), (0.75, 0.999, 10.0), (0.8, 0.999, 10.0), (0.9, 0.998, 10.0), (1.0, 0.998, 10.0), (1.1, 0.998, 10.0), (1.05, 0.998, 10.0), (1.2, 0.998, 10.0), (1.3, 0.998, 10.0), (1.4, 0.994, 10.0), (1.5, 0.994, 10.0), (1.5001, 0.0, 10.0), (1.5002, 0.0, 10.0)], 1.487453, -1.0, -1.0, 0, 69.661556, 0, 2.46, 0.0)
const LZ_TK23 = Glass(GlassID(AGF, 1704), 1, 2.4913793, -0.0113678535, 0.010280255, 0.00147657981, -0.00020427916, 1.15740924e-5, 0.0, 0.0, NaN, NaN, 0.365, 2.3254, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, -0.0014, -1.0, -1.0, 5.8, -1.0, 0.0, -1.0, [(0.3, 1.0e-6, 10.0), (0.32, 0.051, 10.0), (0.34, 0.385, 10.0), (0.36, 0.776, 10.0), (0.38, 0.931, 10.0), (0.4, 0.96, 10.0), (0.42, 0.984, 10.0), (0.44, 0.986, 10.0), (0.46, 0.989, 10.0), (0.48, 0.992, 10.0), (0.5, 0.994, 10.0), (0.52, 0.995, 10.0), (0.54, 0.995, 10.0), (0.56, 0.995, 10.0), (0.58, 0.994, 10.0), (0.6, 0.994, 10.0), (0.62, 0.994, 10.0), (0.64, 0.994, 10.0), (0.66, 0.994, 10.0), (0.68, 0.994, 10.0), (0.7, 0.994, 10.0), (0.75, 0.994, 10.0), (0.8, 0.994, 10.0), (0.9, 0.992, 10.0), (1.0, 0.992, 10.0), (1.05, 0.992, 10.0), (1.1, 0.992, 10.0), (1.2, 0.993, 10.0), (1.3, 0.993, 10.0), (1.4, 0.983, 10.0), (1.5, 0.987, 10.0), (1.5, 1.0e-6, 10.0)], 1.589173, -1.0, -1.0, 0, 60.923398, 0, 3.24, 0.0)
end # module

max_stars_repo_name: rambunctiousapple/GlassCat

max_issues_repo_name: rambunctiousapple/GlassCat

max_forks_repo_name: rambunctiousapple/GlassCat


text:
#=
  xkcd problem (Knapsack)  in Google CP Solver.

  This is a of of my Pythons Or-tools program
  http://hakank.org/ortools/xkcd.py to Julia

  Orginal comment (sligly edited):
  """
  http://xkcd.com/287/

  Some amount (or none) of each dish should be ordered to give a total
  of exact 15.05

  Compare with the following models:
  * Comet: http://www.hakank.org/comet/xkcd.co
  * ECLiPSE: http://www.hakank.org/eclipse/xkcd.ecl
  * Gecode: http://www.hakank.org/gecode/xkcd.cpp
  * Gecode/R: http://www.hakank.org/gecode_r/xkcd.rb
  * MiniZinc: http://www.hakank.org/minizinc/xkcd.mzn
  * Tailor: http://www.hakank.org/minizinc/xkcd.mzn
  * SICtus: http://www.hakank.org/sicstus/xkcd.pl
  * Zinc: http://www.hakank.org/minizinc/xkcd.zinc

  This model was created by Hakan Kjellerstrand (hakank@gmail.com)
  Also see my other Google Or-tools models:
  http://www.hakank.org/or_tools/
  """

#
# Things to change from the Python code
#  - the import
#  - range -> 1:...  or 0:...-1   (or using Julia's range)
#  - print -> println + adding spaces
#  - format codes: (x%i) -> " x$i"
#  - remove ":" in "if:", "else:" etc
#  and
#  - be careful with indentation when copying code otherwise
#    it can be hard to see what it mean...
#
=#
using PyCall

# Be sure that ortools are installed correctly
ot = pyimport("ortools.constraint_solver.pywrapcp")

# Create the solver
solver = ot.Solver("xkcd")
ot.Solver("xkcd")

#
# data
#
num_prices = 6
println("num_prices: $num_prices")

# for price and total: multiplied by 100 to be able to use integers
price = [215, 275, 335, 355, 420, 580]
println("price:$price")
total = 1505
println("total:$total")
products = [
    "mixed fruit", "french fries", "side salad", "host wings",
    "mozzarella sticks", "samples place"
]
println("products:$products")

#
# declare the variables
#

# how many items of each dish
x = [solver.IntVar(0, 10, "x$i") for i in 1:num_prices]
# println("x:$x")
z = solver.IntVar(0, 1505, "z")
# println("z:$z")
#
# constraints
#
solver.Add(z == solver.Sum([x[i] * price[i] for i in 1:num_prices]))
solver.Add(z == total)

#
# solution and search
#
solution = solver.Assignment()
solution.Add([x[i] for i in 1:num_prices])
solution.Add(z)

# println("solution:$solution")

collector = solver.AllSolutionCollector(solution)
# collector = solver.FirstSolutionCollector(solution)
# search_log = solver.SearchLog(100, x[0])
solver.Solve(
    solver.Phase([x[i] for i in 1:num_prices], solver.INT_VAR_SIMPLE,
                solver.ASSIGN_MIN_VALUE), [collector])

num_solutions = collector.SolutionCount()
println("\nnum_solutions: ", num_solutions)
if num_solutions > 0
    # NOTE: The solution ids are 0-based
    # (Julia migh crash if this is wrong)
    for s in 0:num_solutions-1
        println("solution #$(s+1)")
        println("z:", collector.Value(s, z) / 100.0)
        # But this is 1-based since it's Julia now
        xval = [collector.Value(s, x[i]) for i in 1:num_prices]
        println("x:", xval)
        for i in 1:num_prices
             if xval[i] > 0
                 println(xval[i], " of ", products[i], ": ", price[i] / 100.0)
             end
        end
        println()
    end
    println("num_solutions:", num_solutions)
    println("failures:", solver.Failures())
    println("branches:", solver.Branches())
    println("WallTime:", solver.WallTime())

else
    print("No solutions found")
end

ext: jl

max_stars_repo_name: tias/hakank

max_issues_repo_name: tias/hakank

max_forks_repo_name: tias/hakank


text:
export DefaultArray

# To solve this problem, you'll have to improve the `struct` definition and modify/add constructors
struct DefaultArray{T, N} <: AbstractArray{T, N}
    parentarray::Array{T,N}
    defaultvalue::T
end
DefaultArray(parentarray, defaultvalue) = DefaultArray{promote_type(eltype(parentarray), typeof(defaultvalue)), ndims(parentarray)}(parentarray, defaultvalue)
DefaultArray(parentarray, nothing) = DefaultArray{Union{eltype(parentarray), Nothing}, ndimsndims(parentarray)}(parentarray, nothing)

@inline Base.getindex(a::DefaultArray{T, N}, i::Vararg{Int,N}) where {T,N} = checkbounds(Bool, a, i...) ? a.parentarray[i...] : a.defaultvalue
Base.size(a::DefaultArray) = size(a.parentarray)


text:
function MaximalOrder(K::NfAbsNS; discriminant::fmpz = fmpz(-1), ramified_primes::Vector{fmpz} = fmpz[])
  try
    c = _get_maximal_order(K)::NfAbsOrd{NfAbsNS, NfAbsNSElem}
    return c
  catch e
    if !isa(e, AccessorNotSetError)
      rethrow(e)
    end
    O = maximal_order_from_components(K)
    O.ismaximal = 1
    _set_maximal_order(K, O)
    return O
  end
end

###############################################################################
#
#  Generic code for orders
#
###############################################################################

function new_maximal_order(O::NfAbsOrd{NfAbsNS, NfAbsNSElem}; index_divisors::Vector{fmpz} = fmpz[], disc::fmpz = fmpz(-1), ramified_primes::Vector{fmpz} = fmpz[]) where {S, T}
  return maximal_order_round_four(O, index_divisors = index_divisors, disc = disc, ramified_primes = ramified_primes)
end

function maximal_order_round_four(O::NfAbsOrd{NfAbsNS, NfAbsNSElem}; index_divisors::Vector{fmpz} = fmpz[], disc::fmpz = fmpz(-1), ramified_primes::Vector{fmpz} = fmpz[])
  OO = O
  M = trace_matrix(O)
  l = divisors(M, discriminant(O))
  if !isempty(index_divisors)
    push!(l, index_divisors)
  end
  if !isempty(ramified_primes)
    push!(l, ramified_primes)
  end
  l = coprime_base(l)
  for s in l
    if disc != -1
      u = divexact(discriminant(OO), disc)
      if isone(gcd(u, s))
        continue
      end
    end
    @vtime :NfOrd fac = factor(s)
    for (p, j) in fac
      @vprint :NfOrd 1 "Computing p-maximal overorder for $p ..."
      O1 = pmaximal_overorder(O, p)
      if valuation(discriminant(O1), p) < valuation(discriminant(OO),p)
        OO += O1
      end
      @vprint :NfOrd 1 "done\n"
    end
  end
  OO.ismaximal = 1
  return OO
end

function maximal_order_from_components(L::NfAbsNS; disc::fmpz = fmpz(-1), ramified_primes::Vector{fmpz} = fmpz[])
  BKs, lp, disc_order = _maximal_order_of_components(L)
  B = _product_basis(BKs)
  OO = Order(L, B, check = false, cached = false, isbasis = true)
  OO.disc = disc_order
  if disc != -1 && discriminant(OO) == disc
    OO.ismaximal = 1
    return OO
  end
  if ngens(L) == 1
    OO.ismaximal = 1
    return OO
  end
  if !isempty(ramified_primes)
    append!(lp, ramified_primes)
  end
  lp = coprime_base(lp)
  for p in lp
    if isprime(p)
      OO = pmaximal_overorder(OO, p)
    else
      fac = factor(p)
      for (k, v) in fac
        OO = pmaximal_overorder(OO, k)
      end
    end
  end
  OO.ismaximal = 1
  return OO
end

function _product_basis(l::Vector{Vector{NfAbsNSElem}})
  nelems = 1
  for i = 1:length(l)
    nelems *= length(l[i])
  end
  K = parent(l[1][1])
  B = typeof(l[1])(undef, nelems)
  ind = length(l[1])
  for i = 1:ind
    B[i] = l[1][i]
  end
  for jj = 2:length(l)
    new_deg = length(l[jj])
    for i = 2:new_deg
      for j = 1:ind
        B[(i-1)* ind + j] = K(B[j].data * l[jj][i].data, false)
      end
    end
    ind *= new_deg
  end
  return B
end

function product_basis(l::Vector{Vector{T}}) where T <: Union{NfAbsOrdElem, NfRelOrdElem, NumFieldElem}
  nelems = 1
  for i = 1:length(l)
    nelems *= length(l[i])
  end
  B = typeof(l[1])(undef, nelems)
  ind = length(l[1])
  for i = 1:ind
    B[i] = l[1][i]
  end
  for jj = 2:length(l)
    new_deg = length(l[jj])
    for i = 2:new_deg
      for j = 1:ind
        B[(i-1)* ind + j] = B[j] * l[jj][i]
      end
    end
    ind *= new_deg
  end
  return B
end

function product_basis(l1::Vector{T}, l2::Vector{T}) where T <: Union{NfAbsOrdElem, NfRelOrdElem, NumFieldElem}
  B = Vector{typeof(l1[1])}(undef, length(l1)*length(l2))
  for i = 1:length(l1)
    B[i] = l1[i]
  end
  for i = 1:length(l2)
    for j = 1:length(l1)
      B[(i-1)* length(l1) + j] = B[j] * l2[i]
    end
  end
  return B
end

function _maximal_order_of_components(L::NfAbsNS) where {S, T}
  Qx, x = PolynomialRing(FlintQQ, "x")
  fields = Vector{Tuple{AnticNumberField, NfAbsToNfAbsNS}}(undef, length(L.pol))
  for i = 1:length(L.pol)
    fields[i] = component(L, i)
  end
  #Now, bring the maximal order of every component in L
  B = Vector{Vector{NfAbsNSElem}}(undef, length(fields))
  d = fmpz(1)
  for i = 1:length(fields)
    OK = maximal_order(fields[i][1])
    d *= discriminant(OK)^(divexact(degree(L), degree(OK)))
    BOK = basis(OK, fields[i][1])
    BK = Vector{NfAbsNSElem}(undef, degree(OK))
    for j = 1:length(BK)
      BK[j] = fields[i][2](BOK[j])
    end
    B[i] = BK
  end
  lp = fmpz[]
  for i = 1:length(fields)
    for j = i+1:length(fields)
      push!(lp, gcd(discriminant(maximal_order(fields[i][1])), discriminant(maximal_order(fields[j][1]))))
    end
  end
  return B, lp, d
end

function pradical_trace1(O::NfAbsOrd{NfAbsNS, NfAbsNSElem}, p::Union{Int, fmpz})
  return pradical_trace(O, p)
end

function new_pradical_frobenius1(O::NfAbsOrd{NfAbsNS, NfAbsNSElem}, p::Int)
  R = GF(p, cached = false)
  d = degree(O)
  K = nf(O)
  Rx = PolynomialRing(R, "x", cached = false)[1]
  Zx = PolynomialRing(FlintZZ, "x")[1]
  j = clog(fmpz(d), p)
  els_in_pradical = elem_type(O)[]
  M1 = zero_matrix(FlintZZ, 2*d, d)
  gens = elem_type(O)[O(p)]
  for i = 1:ngens(K)
    g = isunivariate(K.pol[i])[2]
    sqf = factor_squarefree(Rx(g))
    p1 = one(Rx)
    for (x, v) in sqf
      if v > 1
        p1 = mul!(p1, p1, x)
      end
    end
    pol = lift(Zx, p1)
    elK = O(evaluate(pol, K[i]))
    push!(gens, elK)
    Mi = representation_matrix_mod(elK, fmpz(p))
    _copy_matrix_into_matrix(M1, 1, 1, Mi)
    hnf_modular_eldiv!(M1, fmpz(p), :lowerleft)
  end
  powers = Dict{Int, Vector{fmpz}}()
  B = basis(O, copy = false)
  it = 0
  while true
    if it == j
      I = ideal(O, M1, false, true)
      reverse!(gens)
      I.gens = gens
      I.minimum = fmpz(p)
      return I
    end
    it += 1
    indices = Int[]
    for i = 1:d
      if !isone(M1[i, i])
        push!(indices, i)
      end
    end
    nr = length(indices)
    A = zero_matrix(R, d, nr + d)
    ind = 0
    for i in 1:d
      if !(i in indices)
        continue
      end
      ind += 1
      if haskey(powers, i)
        ar = copy(powers[i])
        for k in 1:d
          A[k, ind] = ar[k]
        end
      else
        t = powermod(B[i], p, p)
        ar = coordinates(t, copy = true)
        powers[i] = copy(ar)
        if iszero(t)
          continue
        end
        for k in 1:d
          A[k, ind] = R(ar[k])
        end
      end
    end
    for s = 1:d
      for i = 1:s
        A[i, s+nr] = R(M1[s, i])
      end
    end
    X = right_kernel_basis(A)
    if isempty(X)
      I = ideal(O, M1, false, true)
      reverse!(gens)
      I.gens = gens
      I.minimum = fmpz(p)
      return I
    end
    #First, find the generators
    new_gens = Vector{elem_type(O)}()
    for i = 1:length(X)
      coords = zeros(FlintZZ, d)
      for j=1:nr
        coords[indices[j]] = lift(X[i][j])
      end
      if !iszero(coords)
        new_el = O(coords)
        push!(new_gens, new_el)
      end
    end
    if iszero(length(new_gens))
      I = ideal(O, M1, false, true)
      reverse!(gens)
      I.gens = gens
      I.minimum = fmpz(p)
      return I
    end
    #Then, construct the basis matrix of the ideal
    m1 = zero_matrix(FlintZZ, length(new_gens) + d, d)
    for i = 1:length(new_gens)
      el = coordinates(new_gens[i], copy = true)
      for j = 1:nr
        m1[i, indices[j]] = el[indices[j]]
      end
    end
    for i = 1:d
      for s = 1:i
        m1[i+length(new_gens), s] = M1[i, s]
      end
    end
    hnf_modular_eldiv!(m1, fmpz(p), :lowerleft)
    M1 = sub(m1, length(new_gens)+1:nrows(m1), 1:d)
    append!(gens, new_gens)
  end
end


text:
"""
To run:
```
julia --project=. exampleUsage.jl
```
"""

using DelimitedFiles
using Flux
using Random
using Statistics

include("DiscriminativeKalmanFilter.jl")

# setup
rng = MersenneTwister(42)

# data source
z = readdlm("../data/z.csv", ',')
x = readdlm("../data/x.csv", ',')

# dimensions of latent states and observations, respectively
dz = size(z)[2]
dx = size(x)[2]

# training data
train_idx = 1:5000
n_train = size(train_idx)[1]
x_train = x[train_idx, :]
z_train = z[train_idx, :]

# test data
test_idx = 5001:6000
n_test = size(test_idx)[1]
x_test = x[test_idx, :]
z_test = z[test_idx, :]

# learn state model parameters A & Gamma from Eq. (2.1b)
A0 = z_train[2:end, :] \ z_train[1:end-1, :]
Gamma0 = cov(z_train[2:end, :] - z_train[1:end-1, :] * A0)

# split training set in order to train f() and Q() from Eq. (2.2) separately
perm = randperm(MersenneTwister(42), n_train)
x_train_mean = x_train[perm[1:Int(0.9 * 5000)], :]
x_train_covariance = x_train[perm[Int(0.9 * 5000)+1:end], :]
z_train_mean = z_train[perm[1:Int(0.9 * 5000)], :]
z_train_covariance = z_train[perm[Int(0.9 * 5000)+1:end], :]

function NeuralNetwork()
    return Chain(
        Dense(dx, 10, relu),
        Dropout(0.1),
        Dense(10, dz)
    )
end

m = NeuralNetwork()
data = Flux.Data.DataLoader((x_train_mean', z_train_mean'), batchsize = 100, shuffle = true, rng = rng)
loss(x, y) = sum(Flux.Losses.mse(m(x), y))

for i in 1:20
    Flux.train!(loss, Flux.params(m), data, Flux.Optimise.ADAM())
end

Q = cov(z_train_covariance - m(x_train_covariance')')

fx(x) = m(x)
Qx(x) = Q

f0 = fx(x_test[1, :])
Q0 = Qx(x_test[1, :])
S = cov(z_train)

DKF = DiscriminativeKalmanFilter(A0, Gamma0, S, fx, Qx, f0, Q0, dz)

# perform filtering
z_preds = zeros(size(z_test))
z_preds[1, :] = f0
for i in 2:n_test
    z_preds[i, :] = predict!(DKF, x_test[i, :])
end

print("normalized rmse ", sqrt(mean((z_test - z_preds) .^ 2)) / sqrt(mean(z_test .^ 2)))


text:
import Dolark
import Dolo
using StaticArrays

using Plots

# We need YAML.jl from the master branch

hmodel = Dolark.HModel("models/ayiagari.yaml")

y0, z0, p = hmodel.calibration[:aggregate, :exogenous, :parameters]

m0,s0,x0,pa = hmodel.agent.calibration[:exogenous, :states, :controls, :parameters]

Dolark.projection(hmodel, y0, z0, p)

Dolark.equilibrium(hmodel, s0, x0, y0, z0, y0, z0, p)

sol_agent = Dolo.improved_time_iteration(hmodel.agent)

# sol_agent = Dolo.time_iteration(hmodel.agent)

xx0 = Dolo.MSM([sol_agent.dr(i, sol_agent.dr.grid_endo.nodes) for i=1:Dolo.n_nodes(sol_agent.dr.grid_exo)])

tab0 = Dolo.tabulate(hmodel.agent, sol_agent.dr, :a)

plot(tab0[:a], tab0[:c])

μ = Dolo.ergodic_distribution(hmodel.agent, sol_agent)
# μ = μ[:]

using StaticArrays

dmodel = Dolark.discretize(hmodel, sol_agent)

# x = dmodel.F.x0
x = xx0
y = SVector(y0...)
z = SVector(z0...)
p = Dolark.projection(hmodel, y,z,SVector(hmodel.calibration[:parameters]...))

u = Dolark.Unknown(μ, p, x, y)

using LinearAlgebra: I
using LinearMaps

res, J = Dolark.Residual(dmodel, u);

u_ = Dolark.flatten(u)
@time J*u_

r_ = Dolark.flatten(res)

# Check that jacobian is correct

using FiniteDifferences

@time M0 = convert(Matrix, J)

using FiniteDiff
M1 = FiniteDiff.finite_difference_jacobian(u->Dolark.Residual(dmodel, u; diff=false), u_) # ; relstep=1e-10)
M1_ = jacobian(forward_fdm(5, 1), u->Dolark.Residual(dmodel, u; diff=false), u_)[1]  # more precise

DD = abs.(M0 - M1_)

D = (DD .>= 1e-8)

D[1,1]=1
D[end,end]=1

spy(D)

# There are non zero values for F_p, i.e. DD[303:602,301:302]

# M0[1,1:90] .= 1.0
# u_[1] = 0

k1 = xx0
k2 = xx0
kp = p

# dmodel.F(k1, k2, p, p)

R =  dmodel.F(k1, k2)
N_x = length(k1.data)*length(k1.data[1])
N_p = length(p)

L_A = Dolo.df_A(dmodel.F, k1, k2)
L_B = Dolo.df_B(dmodel.F, k1, k2)
L_p1, L_p2 = Dolo.df_e(dmodel.F, xx0, xx0, p,p)
J_A = LinearMaps.LinearMap(u->L_A*u, N_x, N_x)
J_B = LinearMaps.LinearMap(u->L_B*u, N_x, N_x)
J_p1 = LinearMaps.LinearMap(u->L_p1*u, N_x, N_p)
J_p2 = LinearMaps.LinearMap(u->L_p2*u, N_x, N_p)

import LinearMaps
M_A = convert(Matrix,(J_A))
M_B = convert(Matrix,(J_B))
M_p1 = convert(Matrix,(J_p1))
M_p2 = convert(Matrix,(J_p2))

ff = u->flatten(dmodel.F(unflatten(u, k1), k2))
M1 = FiniteDiff.finite_difference_jacobian(ff, flatten(k1); absstep=1e-8)
M1_ = jacobian(central_fdm(5, 1), ff, flatten(k1))[1] # this is more precise

ff = u->flatten(dmodel.F(k1, unflatten(u, k2)))
M2 = FiniteDiff.finite_difference_jacobian(ff, flatten(k2)) # ; relstep=1e-10)
M2_ = jacobian(central_fdm(5, 1), ff, flatten(k2))[1]

ff = u->flatten(dmodel.F(k1, k2; exo=(u,p)))
Mp1 = FiniteDiff.finite_difference_jacobian(ff, p) # ; relstep=1e-10)
Mp1_ = jacobian(forward_fdm(5, 1), ff, p)[1]

ff = u->flatten(dmodel.F(k1, k2; exo=(p,u)))
Mp2 = FiniteDiff.finite_difference_jacobian(ff, p) # ; relstep=1e-10)
Mp2_ = jacobian(central_fdm(5, 1), ff, p)[1]

using FiniteDifferences

maximum(abs,M_A - M1_)   # 1e-7
maximum(abs,M_B - M2_)  ## very small
maximum(abs,M_p1 - Mp1)  # 1e-6
maximum(abs,M_p2 - Mp2)  # 1e-6
# there is probably something wrong in the chain derivatives inside Euler (CHECK)

# try to solve the system

@time us = Dolark.proto_solve_steady_state(dmodel, u; numdiff=false, use_blas=true, maxit=8);   # this to work (it is slow)

# check the solution
dr = deepcopy(dmodel.F.dr.dr)
Dolo.set_values!(dr, us.x)

tab = Dolo.tabulate(hmodel.agent, dr, :a)

# plot!(pl, tab[:a], tab[:i])
# plot!(pl, tab[:a], tab[:a])
pl = plot(tab[:a], tab[:c])
plot!(pl, tab0[:a], tab0[:c]) # it looks reasonable

### now we want to use fast jacobian calculation
sol = Dolark.proto_solve_steady_state(dmodel, u; numdiff=false, use_blas=true, maxit=5) #this doesn't work so well

@time new = Dolark.proto_solve_steady_state(dmodel, u);


text:
using Test
using BenchmarkTools

include(joinpath(dirname(dirname(@__FILE__)), "examples", "cartesian.jl"))

using .Cartesian

const nx = 10
const h = 2/(nx-1)
println("building grid")
const cgrid = CartesianGrid(nx,nx,h)

println("tests...")
@test nb_nodes(cgrid) == nx*nx
const crds = coordinates(cgrid)
@test crds[1,1:2] == [-1.0, -1.0]
@test crds[end,1:2] == [1.0, 1.0]

println("nb neighbors...")
@btime nb_neighbors(cgrid, 4, (g,I) -> I[1] == 1)

# if isinteractive()
#   using Plots
#   scatter(crds[:,1], crds[:,2])
# end


text:
"""
    IdentityMultiple{T} < AbstractMatrix{T} where T

A scalar multiple of the identity matrix of given order and numeric type.

### Fields

- `M` -- uniform scaling operator of type `T`
- `n` -- size of the identity matrix

### Notes

This type can be used to create multiples of the identity of given size. Since
only the multiple and the order are stored, the allocations are minimal.

Internally, the type wraps Julia's lazy multiple of the identity operator,
`UniformScaling`. `IdentityMultiple` subtypes `AbstractMatix`, hence it can be
used in usual matrix arithmetic and for dispatch on `AbstractMatrix`.

The difference between `UniformScaling` and `IdentityMultiple` is that while the
size of the former is generic, the size of the latter is fixed.

### Examples

The easiest way to create an identity multiple is to use the callable version
of `LinearAlgebra.I`:

```jldoctest identitymultiple
julia> using MathematicalSystems: IdentityMultiple

julia> I2 = I(2)
IdentityMultiple{Float64} of value 1.0 and order 2

julia> I2 + I2
IdentityMultiple{Float64} of value 2.0 and order 2

julia> 4*I2
IdentityMultiple{Float64} of value 4.0 and order 2
```

The numeric type (default `Float64`) can be passed as a second argument:

```jldoctest identitymultiple
julia> I2r = I(2, Rational{Int})
IdentityMultiple{Rational{Int64}} of value 1//1 and order 2

julia> I2r + I2r
IdentityMultiple{Rational{Int64}} of value 2//1 and order 2

julia> 4*I2r
IdentityMultiple{Rational{Int64}} of value 4//1 and order 2
```

To create the matrix with a value different from the default (`1.0`), there are
two ways. Either pass the value through the callable `I`, as in:

```jldoctest identitymultiple
julia> I2 = I(2.0, 2)
IdentityMultiple{Float64} of value 2.0 and order 2

julia> I2r = I(2//1, 2)
IdentityMultiple{Rational{Int64}} of value 2//1 and order 2
```

Or use the constructor passing the `UniformScaling` (`I`):

```jldoctest identitymultiple
julia> I2 = IdentityMultiple(2.0*I, 2)
IdentityMultiple{Float64} of value 2.0 and order 2

julia> I2r = IdentityMultiple(2//1*I, 2)
IdentityMultiple{Rational{Int64}} of value 2//1 and order 2
```
"""
struct IdentityMultiple{T} <: AbstractMatrix{T}
    M::UniformScaling{T}
    n::Int
    IdentityMultiple(M::UniformScaling{T}, n::Int) where {T} = begin
        (n < 1) && throw(ArgumentError("the dimension of `IdentityMultiple` cannot be negative or zero"))
        return new{T}(M, n)
    end
end

Base.IndexStyle(::Type{<:IdentityMultiple}) = IndexLinear()
Base.size(𝐼::IdentityMultiple) = (𝐼.n, 𝐼.n)

function Base.getindex(𝐼::IdentityMultiple, inds...)
    any(idx -> idx > 𝐼.n, inds) && throw(BoundsError(𝐼, inds))
    getindex(𝐼.M, inds...)
end

function Base.getindex(𝐼::IdentityMultiple{T}, ind) where {T}
    if 1 ≤ ind ≤ 𝐼.n^2
        return rem(ind-1, 𝐼.n+1) == 0 ? 𝐼.M.λ : zero(T)
    else
        throw(BoundsError(𝐼, ind))
    end
end

function Base.setindex!(𝐼::IdentityMultiple, X, inds...)
    error("cannot store a value in an `IdentityMultiple` because this type is immutable")
end

Base.:(-)(𝐼::IdentityMultiple) = IdentityMultiple(-𝐼.M, 𝐼.n)
Base.:(+)(𝐼::IdentityMultiple, M::AbstractMatrix) = 𝐼.M + M
Base.:(+)(M::AbstractMatrix, 𝐼::IdentityMultiple) = M + 𝐼.M
Base.:(*)(x::Number, 𝐼::IdentityMultiple) = IdentityMultiple(x * 𝐼.M, 𝐼.n)
Base.:(*)(𝐼::IdentityMultiple, x::Number) = IdentityMultiple(x * 𝐼.M, 𝐼.n)
Base.:(/)(𝐼::IdentityMultiple, x::Number) = IdentityMultiple(𝐼.M / x, 𝐼.n)

function Base.:(*)(𝐼::IdentityMultiple, v::AbstractVector)
    @assert 𝐼.n == length(v)
    return 𝐼.M.λ * v
end

function Base.:(*)(𝐼::IdentityMultiple, A::AbstractMatrix)
    @assert 𝐼.n == size(A, 1)
    return 𝐼.M.λ * A
end

function Base.:(*)(A::AbstractMatrix, 𝐼::IdentityMultiple)
    @assert size(A, 2) == 𝐼.n
    return A * 𝐼.M.λ
end

# right-division
function Base.:(/)(A::AbstractMatrix, 𝐼::IdentityMultiple)
    @assert size(A, 2) == 𝐼.n
    return A * inv(𝐼.M.λ)
end

function Base.:(+)(𝐼1::IdentityMultiple, 𝐼2::IdentityMultiple)
    @assert 𝐼1.n == 𝐼2.n
    return IdentityMultiple(𝐼1.M + 𝐼2.M, 𝐼1.n)
end

function Base.:(-)(𝐼1::IdentityMultiple, 𝐼2::IdentityMultiple)
    @assert 𝐼1.n == 𝐼2.n
    return IdentityMultiple(𝐼1.M - 𝐼2.M, 𝐼1.n)
end

function Base.:(*)(𝐼1::IdentityMultiple, 𝐼2::IdentityMultiple)
    @assert 𝐼1.n == 𝐼2.n
    return IdentityMultiple(𝐼1.M * 𝐼2.M, 𝐼1.n)
end

function Base.:(*)(𝐼::IdentityMultiple{T}, U::UniformScaling{S}) where {T<:Number, S<:Number}
    return IdentityMultiple(𝐼.M.λ * U, 𝐼.n)
end

function Base.:(*)(U::UniformScaling{T}, 𝐼::IdentityMultiple{S}) where {T<:Number, S<:Number}
    return IdentityMultiple(𝐼.M.λ * U, 𝐼.n)
end

function Base.:(/)(𝐼::IdentityMultiple{T}, U::UniformScaling{S}) where {T<:Number, S<:Number}
    @assert !iszero(U.λ)
    return IdentityMultiple(𝐼.M * inv(U.λ), 𝐼.n)
end

function Base.:(/)(U::UniformScaling{T}, 𝐼::IdentityMultiple{S}) where {T<:Number, S<:Number}
    @assert !iszero(𝐼.M.λ)
    return IdentityMultiple(U * inv(𝐼.M.λ), 𝐼.n)
end

function Base.show(io::IO, ::MIME"text/plain", 𝐼::IdentityMultiple{T}) where T
    print(io, "$(typeof(𝐼)) of value $(𝐼.M.λ) and order $(𝐼.n)")
end

# callable identity matrix given the size and the numeric type
LinearAlgebra.I(n::Int, N::DataType=Float64) = IdentityMultiple(one(N)*I, n)

# callable identity matrix given the scaling factor and the size
IdentityMultiple(λ::Number, n::Int) = IdentityMultiple(λ*I, n)
LinearAlgebra.I(λ::Number, n::Int) = IdentityMultiple(λ*I, n)

function LinearAlgebra.Hermitian(𝐼::IdentityMultiple)
    return Hermitian(Diagonal(fill(𝐼.M.λ, 𝐼.n)))
end

Base.exp(𝐼::IdentityMultiple) = IdentityMultiple(exp(𝐼.M.λ), 𝐼.n)


text:
using ESWA_Project
using Test

@testset "ESWA_Project.jl" begin
end


text:
# This code is a simple Endogenous Grid Method (EGM) port in Julia of the CGM code.
# I tried to make it as similar as possible.
# No optimizations for speed are introduced in this version (but it is still quite fast compared to VFI).
# In particular, this is a terrible way to write Julia code (should introduce function barriers and proper scoping).
# Tyler Beason 2018

using Interpolations

# utility functions and related
utility(c::T1,gamma::T2) where {T1,T2<:Real} = (c^(1.0-gamma))/(1.0-gamma)
uprime(c::T1,gamma::T2) where {T1,T2<:Real} = c^(-gamma)
uprimeinv(c::T1,gamma::T2) where {T1,T2<:Real} = c^(-1.0/gamma)

# find a number in a grid
ntoi(x::Number,g::AbstractArray) = convert(Int,round((clamp(x,g[1],g[end]) - g[1])/step(g) + 1))
#ntoi(x::Number,g::AbstractArray) = max(searchsortedlast(g,x),1) #equivalent to above, but works with non-Range types

# parameters and such
const tb=20
const tr=65
const td=100
const nqp=3
const nalfa=201
const ns=1001
const rf=1.02
const sigma_r=0.157^2
const exc= 0.04
const delta=0.96
const gamma= 10.0

const ageprof = [-2.170042+2.700381, 0.16818, -0.0323371/10, 0.0019704/100]
const sigt_y=0.0738
const sigp_y=0.01065
const ret_fac=0.68212
const reg_coef = 0.0

const weig = [1/6; 2/3; 1/6]
const grid = [-sqrt(3); 0.0; sqrt(3)]

# SURVIVAL PROBABILITIES
survprob = Vector{Float64}(80)
survprob[1] = 0.99845
survprob[2] = 0.99839
survprob[3] = 0.99833
survprob[4] = 0.9983
survprob[5] = 0.99827
survprob[6] = 0.99826
survprob[7] = 0.99824
survprob[8] = 0.9982
survprob[9] = 0.99813
survprob[10] = 0.99804
survprob[11] = 0.99795
survprob[12] = 0.99785
survprob[13] = 0.99776
survprob[14] = 0.99766
survprob[15] = 0.99755
survprob[16] = 0.99743
survprob[17] = 0.9973
survprob[18] = 0.99718
survprob[19] = 0.99707
survprob[20] = 0.99696
survprob[21] = 0.99685
survprob[22] = 0.99672
survprob[23] = 0.99656
survprob[24] = 0.99635
survprob[25] = 0.9961
survprob[26] = 0.99579
survprob[27] = 0.99543
survprob[28] = 0.99504
survprob[29] = 0.99463
survprob[30] = 0.9942
survprob[31] = 0.9937
survprob[32] = 0.99311
survprob[33] = 0.99245
survprob[34] = 0.99172
survprob[35] = 0.99091
survprob[36] = 0.99005
survprob[37] = 0.98911
survprob[38] = 0.98803
survprob[39] = 0.9868
survprob[40] = 0.98545
survprob[41] = 0.98409
survprob[42] = 0.9827
survprob[43] = 0.98123
survprob[44] = 0.97961
survprob[45] = 0.97786
survprob[46] = 0.97603
survprob[47] = 0.97414
survprob[48] = 0.97207
survprob[49] = 0.9697
survprob[50] = 0.96699
survprob[51] = 0.96393
survprob[52] = 0.96055
survprob[53] = 0.9569
survprob[54] = 0.9531
survprob[55] = 0.94921
survprob[56] = 0.94508
survprob[57] = 0.94057
survprob[58] = 0.9357
survprob[59] = 0.93031
survprob[60] = 0.92424
survprob[61] = 0.91717
survprob[62] = 0.90922
survprob[63] = 0.90089
survprob[64] = 0.89282
survprob[65] = 0.88503
survprob[66] = 0.87622
survprob[67] = 0.86576
survprob[68] = 0.8544
survprob[69] = 0.8423
survprob[70] = 0.82942
survprob[71] = 0.8154
survprob[72] = 0.80002
survprob[73] = 0.78404
survprob[74] = 0.76842
survprob[75] = 0.75382
survprob[76] = 0.73996
survprob[77] = 0.72464
survprob[78] = 0.71057
survprob[79] = 0.6961
survprob[80] = 0.6809

const delta2 = delta*survprob

const tn = td-tb+1

const gr=grid.*sigma_r^0.5
const eyp=grid.*sigp_y^0.5
const eyt=grid.*sigt_y^0.5
const mu = exc+rf

const expeyp = exp.(eyp)

const galfa = linspace(0.0,1.0,nalfa)
const gret = mu + gr
const gs = range(0.05,0.5,ns) # gs now represents how much savings

# average and transitory income pieces
const f_y = zeros(nqp,tr-1)
for t = (tb+1):tr
   avg = exp(vecdot(ageprof,[1.0; t; t^2; t^3]))
   f_y[:,t-tb] = avg*exp.(eyt)
end
const ret_y= ret_fac*exp(vecdot(ageprof,[1.0; tr; tr^2; tr^3]))

# terminal/starter values
gcash =copy(gs)
c=copy(gs)
alfa=zeros(size(c))
v=utility.(c,gamma)

# policy functions
wpol = zeros(ns,80)
cpol = zeros(ns,80)
alfapol = zeros(ns,80)
vpol = zeros(ns,80)

# interpolation type (linear works just fine for me)
const inttype = Gridded(Linear()) #Gridded(Cubic(Natural()))

# start solution, retirement period first
const tt=80
for ind1 = 1:35
   t = tt-ind1+1
   age = t+tb-1
   println(string(t, " ",age))
   #interpolate cons_tp1
   itp_ctp1 = interpolate((vcat(0.0,gcash),),vcat(0.0,c),inttype)
   itp_vtp1 = interpolate((gcash,),v,inttype)
   for ind2 =  1:ns
      lowalfa2 = 1
      highalfa2 = nalfa
      if (gs[ind2] > 10) && (t < tn-1)
         lowalfa = alfa[ind2] - 0.2
         highalfa = alfa[ind2] + 0.2
         lowalfa2 = ntoi(lowalfa,galfa)
         highalfa2 = ntoi(highalfa,galfa)
      end
      nalfa_r = highalfa2 - lowalfa2 + 1
      galfa_r = galfa[lowalfa2:highalfa2]
      v1 = zeros(nalfa_r)
      for ind5 = 1:nqp
         nw = gs[ind2].*(rf .+ galfa_r .*(gret[ind5]-rf))
         nv = uprime.(itp_ctp1[nw .+ ret_y],gamma) .* (gret[ind5]-rf) * weig[ind5]
         v1 .+= nv
      end
      v2,pt = findmin(vec(v1).^2)
      alfa2 = galfa_r[pt]
      #println(string(t," ",gs[ind2]," ",alfa2, " ",extrema(galfa_r)))
      c1 = 0.0
      v1 = 0.0
      for ind5 = 1:nqp
         nw = gs[ind2]*(rf+ alfa2*(gret[ind5]-rf))
         nv = uprime(itp_ctp1[nw+ret_y],gamma) * (rf+ alfa2*(gret[ind5]-rf)) * weig[ind5]
         c1 += nv
         nvv = itp_vtp1[nw+ret_y]  * weig[ind5]
         v1 += nvv
      end
      c2 = uprimeinv(delta2[t]*c1,gamma)
      #println(string(t," ",gs[ind2]," ",alfa2, " ",c2, " ",gs[ind2] + c2))
      wpol[ind2,t] = gs[ind2] + c2
      alfapol[ind2,t] = alfa2
      cpol[ind2,t] = c2
      vpol[ind2,t] = utility(c2,gamma) + delta2[t]*v1
   end
   gcash = copy(wpol[:,t])
   alfa = copy(alfapol[:,t])
   c = copy(cpol[:,t])
   v = copy(vpol[:,t])
end

# now solve working periods
for ind1 = 1:(tt-35)
   t = 45-ind1+1
   age = t+tb-1
   println(string(t, " ",age))
   #interpolate cons_tp1
   itp_ctp1 = interpolate((vcat(0.0,gcash),),vcat(0.0,c),inttype)
   itp_vtp1 = interpolate((gcash,),v,inttype)
   for ind2 =  1:ns
      lowalfa2 = 1
      highalfa2 = nalfa
      if (gs[ind2] > 10) && (t < tn-1)
         lowalfa = alfa[ind2] - 0.25
         highalfa = alfa[ind2] + 0.25
         lowalfa2 = ntoi(lowalfa,galfa)
         highalfa2 = ntoi(highalfa,galfa)
      end
      nalfa_r = highalfa2 - lowalfa2 + 1
      galfa_r = galfa[lowalfa2:highalfa2]
      v1 = zeros(nalfa_r)
      @inbounds for ind5 = 1:nqp
         nw = gs[ind2].*(rf .+ galfa_r .*(gret[ind5]-rf))
         @inbounds for ind6 = 1:nqp, ind7 = 1:nqp
            ctp1 = nw.+f_y[ind6,t]*(expeyp[ind7]+reg_coef*gret[ind5])
            nv = uprime.(itp_ctp1[ctp1],gamma) .* (gret[ind5]-rf) * (weig[ind5]*weig[ind6]*weig[ind7])
            v1 .+= nv
         end
      end
      v2,pt = findmin(vec(delta2[t]*gs[ind2]*v1).^2)
      alfa2 = galfa_r[pt]
      #println(string(t," ",gs[ind2]," ",alfa2, " ",extrema(galfa_r)))
      c1 = 0.0
      v1 = 0.0
      @inbounds for ind5 = 1:nqp
         nw = gs[ind2]*(rf+ alfa2*(gret[ind5]-rf))
         @inbounds for ind6 = 1:nqp, ind7 = 1:nqp
            nv = uprime.(itp_ctp1[nw+f_y[ind6,t]*(expeyp[ind7]+reg_coef*gret[ind5])],gamma) .* (rf+ alfa2*(gret[ind5]-rf)) * (weig[ind5]*weig[ind6]*weig[ind7])
            c1 += nv
            nvv = itp_vtp1[nw+f_y[ind6,t]*(expeyp[ind7]+reg_coef*gret[ind5])] * (weig[ind5]*weig[ind6]*weig[ind7])
            v1 += nvv
         end
      end
      c2 = uprimeinv(delta2[t]*c1,gamma)
      #println(string(t," ",gs[ind2]," ",alfa2, " ",c2, " ",gs[ind2] + c2))
      wpol[ind2,t] = gs[ind2] + c2
      alfapol[ind2,t] = alfa2
      cpol[ind2,t] = c2
      vpol[ind2,t] = utility(c2,gamma) + delta2[t]*v1
   end
   gcash = copy(wpol[:,t])
   alfa = copy(alfapol[:,t])
   c = copy(cpol[:,t])
   v = copy(vpol[:,t])
end

# write out policy and value functions to csv for inspection if you want
writecsv("testalfa_egm.csv",alfapol)
writecsv("testcons_egm.csv",cpol)
writecsv("testwealth_egm.csv",wpol)
writecsv("testvfun_egm.csv",vpol)

############################# SIMULATION
# This begins my own code (CGM did not post simualtion code)

Nhh = 10000

function simincome(Nhh,sig_t,sig_p)
	# deterministic income profile
	coefs = [-2.170042+2.700381; 0.16818; -0.0323371/10; 0.0019704/100]

	reprate = 0.68212
	income = zeros(80,Nhh)
	prm = zeros(80,Nhh)
	prm[1,:] = exp.(sig_p.*randn(1,Nhh))
   tb = 20
	income[1,:] = exp.(vecdot([1.0;(tb+1);(tb+1)^2;(tb+1)^3],coefs)) .* prm[1,:]' .* exp.(sig_t.*randn(1,Nhh))
	for age = (tb+2):tr
		ind = age-tb
      avg = exp.(vecdot([1.0;age;age^2;age^3],coefs))
      prm[ind,:] = prm[ind-1,:]' .* exp.(sig_p.*randn(1,Nhh))
      income[ind,:] = avg .* prm[ind,:]' .* exp.(sig_t.*randn(1,Nhh))
   end
   income[(tr-tb+1):end,:] .= reprate .* exp.(vecdot([1.0;tr;tr^2;tr^3],coefs)) .* prm[tr-tb,:]' #.* exp.(sig_t.*randn(td-tr,Nhh))
	return income
end

income = simincome(Nhh,sigt_y^0.5,sigp_y^0.5)

cons = similar(income)
theta = similar(income)
wealth = similar(income)
wealth[1,:] = 5.0 #exp.(1.0 + randn(Nhh))

println("Simulating")
for t = 1:80 #(tb+1):td
   age = t+tb-1
   println(string(t, " ",age))
	# set up proper policy interpolations
	itp_cons = interpolate((vcat(0.0,wpol[:,t]),),vcat(0.0,cpol[:,t]),inttype)
	itp_theta = interpolate((vcat(0.0,wpol[:,t]),),vcat(0.0,alfapol[:,t]),inttype)

	theta[t,:] = clamp.(itp_theta[wealth[t,:]],0.0,1.0)
	cons[t,:] = itp_cons[wealth[t,:]]

	if age+1<td
      ret = exc .+ (sigma_r^0.5 .* randn(Nhh))
		wealth[t+1,:] = income[t,:] .+ (wealth[t,:] .- cons[t,:]).*(rf .+ theta[t,:].*ret)
	end
end

writecsv("simalfa_egm.csv",theta)
writecsv("simcons_egm.csv",cons)
writecsv("simcash_egm.csv",wealth)
writecsv("simincome_egm.csv",income)

println("Done.")


text:
__precompile__()
# ----------------------------------------------------------------------------
module Tutorial
#=
    see also:
        - the walkthrough at http://vladium.com/tutorials/study_julia_with_me/type_annotations/
=#
# ............................................................................

import InteractiveUtils

function subtypetree(T, depth = 0)
    println('\t' ^ depth, T)
    for t in InteractiveUtils.subtypes(T)
        subtypetree(t, depth + 1)
    end
end

function showfields(T ::Type)
    for i in 1 : fieldcount(T)
        println(fieldoffset(T, i), '\t', fieldname(T, i), "\t::", fieldtype(T, i))
    end
end

# ............................................................................

function bar(x ::Float64) ::Float32
    sin(2π * x)
end

function bar_clipped(x ::Float64)
    x < 0.0 ? 0 : sin(2π * x)
end

function sqrt_or_nothing(x ::Float64) ::Union{Float64, Nothing}
    x < 0.0 ? nothing : √x
end

# ............................................................................

function to_JSON(io ::IO, obj)
    visit(obj, io)
end

function visit(obj, io ::IO)
    error("default visit() called for obj type: ", typeof(obj))
end

function visit(obj ::Real, io ::IO)
    print(io, obj)
end

# note that this is redundant given the 'Real' overload above:
#
# function visit(obj ::Bool, io ::IO)
#     write(io, (obj ? "true" : "false"))
# end

function visit(obj ::AbstractString, io ::IO)
    print(io, '"')
    print(io, obj)
    print(io, '"')

end

function visit(obj ::AbstractArray, io ::IO)
    print(io, '[')
    for i in 1 : length(obj)
        i > 1 && print(io, ", ")
        visit(obj[i], io)
    end
    print(io, ']')
end

function visit(obj ::AbstractDict, io ::IO)
    print(io, '{')
    first = true
    for (k, v) in obj
        first ? first = false : print(io, ", ")
        visit(k ::AbstractString, io) # assert that key is a string
        print(io, " : ")
        visit(v, io)
    end
    print(io, '}')
end

# adding this overload to support tuples:

function visit(obj ::Tuple, io ::IO)
    print(io, '[')
    for i in 1 : length(obj)
        i > 1 && print(io, ", ")
        visit(obj[i], io)
    end
    print(io, ']')
end

end # of module
# ----------------------------------------------------------------------------


text:
function Quadrotor(scenario=:zigzag, Rot=UnitQuaternion{Float64};
        costfun=:Quadratic, normcon=false)
    if scenario == :zigzag
        model = RobotZoo.Quadrotor{Rot}()
        n,m = size(model)

        opts = SolverOptions(
            penalty_scaling=100.,
            penalty_initial=0.1,
        )

        # discretization
        N = 101 # number of knot points
        tf = 5.0
        dt = tf/(N-1) # total time

        # Initial condition
        x0_pos = @SVector [0., -10., 1.]
        x0 = RobotDynamics.build_state(model, x0_pos, UnitQuaternion(I), zeros(3), zeros(3))

        # cost
        costfun == :QuatLQR ? sq = 0 : sq = 1
        rm_quat = @SVector [1,2,3,4,5,6,8,9,10,11,12,13]
        Q_diag = Dynamics.fill_state(model, 1e-5, 1e-5*sq, 1e-3, 1e-3)
        Q = Diagonal(Q_diag)
        R = Diagonal(@SVector fill(1e-4,m))
        q_nom = UnitQuaternion(I)
        v_nom, ω_nom = zeros(3), zeros(3)
        x_nom = Dynamics.build_state(model, zeros(3), q_nom, v_nom, ω_nom)

        if costfun == :QuatLQR
            cost_nom = QuatLQRCost(Q, R, x_nom, w=0.0)
        elseif costfun == :ErrorQuad
            cost_nom = ErrorQuadratic(model, Diagonal(Q_diag[rm_quat]), R, x_nom)
        else
            cost_nom = LQRCost(Q, R, x_nom)
        end

        # waypoints
        wpts = [(@SVector [10,0,1.]),
                (@SVector [-10,0,1.]),
                (@SVector [0,10,1.])]
        times = [33, 66, 101]
        Qw_diag = Dynamics.fill_state(model, 1e3,1*sq,1,1)
        Qf_diag = Dynamics.fill_state(model, 10., 100*sq, 10, 10)
        xf = Dynamics.build_state(model, wpts[end], UnitQuaternion(I), zeros(3), zeros(3))

        costs = map(1:length(wpts)) do i
            r = wpts[i]
            xg = Dynamics.build_state(model, r, q_nom, v_nom, ω_nom)
            if times[i] == N
                Q = Diagonal(Qf_diag)
                w = 40.0
            else
                Q = Diagonal(1e-3*Qw_diag)
                w = 0.1
            end
            if costfun == :QuatLQR
                QuatLQRCost(Q, R, xg, w=w)
            elseif costfun == :ErrorQuad
                Qd = diag(Q)
                ErrorQuadratic(model, Diagonal(Qd[rm_quat]), R, xg)
            else
                LQRCost(Q, R, xg)
            end
        end

        costs_all = map(1:N) do k
            i = findfirst(x->(x ≥ k), times)
            if k ∈ times
                costs[i]
            else
                cost_nom
            end
        end

        obj = Objective(costs_all)

        # Initialization
        u0 = @SVector fill(0.5*9.81/4, m)
        U_hover = [copy(u0) for k = 1:N-1] # initial hovering control trajectory

        # Constraints
        conSet = ConstraintList(n,m,N)
        if normcon
            if use_rot == :slack
                add_constraint!(conSet, QuatSlackConstraint(), 1:N-1)
            else
                add_constraint!(conSet, QuatNormConstraint(), 1:N-1)
                u0 = [u0; (@SVector [1.])]
            end
        end
        bnd = BoundConstraint(n,m, u_min=0.0, u_max=12.0)
        add_constraint!(conSet, bnd, 1:N-1)

        # Problem
        prob = Problem(model, obj, xf, tf, x0=x0, constraints=conSet)
        initial_controls!(prob, U_hover)
        rollout!(prob)

        return prob, opts
    end
end


text:
using Logging
using DataFrames, CSV
using JuMP

export write_results

function write_csv(data::DataFrame, filename::AbstractString)

    @info "Writing csv file with data: " data filename

    open(filename, "w") do io
        CSV.write(io, data)
    end

end

"""
    write_results(variable, name, model_data)
"""
function write_results(variable::AbstractArray, name::AbstractString, model_data::Dict)

    edges = model_data["edges"]
    nodes = model_data["nodes"]
    commodities = model_data["commodities"]
    years = model_data["years"]

    num_nodes = length(model_data["nodes"])
    num_edges = length(edges)
    num_comm = length(model_data["commodities"])

    df = DataFrame(source=String[],
                   sink=String[],
                   commodity=String[],
                   year=Int[],
                   value=Float64[])

    filename = "$(name).csv"

    function get_values(variable::Any, i::Integer, j::Integer, comm::Integer, year::Integer)
        source = nodes[i]
        sink = nodes[j]
        comm_name = commodities[comm]
        year_name = years[year]
        value = JuMP.value(variable[i, j, comm, year])
        value != 0 ? push!(df, (source, sink, comm_name, year_name, value)) : 0
    end

    function iterate_variable(variable::Array{JuMP.VariableRef,4})
        c_indices = keys(variable)
        for index in eachindex(variable)
            (i, j, comm, year) = c_indices[index].I
            get_values(variable, i, j, comm, year)
        end
    end

    function iterate_variable(variable::JuMP.Containers.SparseAxisArray{JuMP.VariableRef,4,NTuple{4,Any}})
        for index in eachindex(variable)
            (i, j, comm, year) = index
            get_values(variable, i, j, comm, year)
        end
    end

    iterate_variable(variable)
    write_csv(df, filename)
end


text:
abstract type RegressionLikelihood{T<:Real} <: Likelihood{T} end

include("gaussian.jl")
include("studentt.jl")
include("laplace.jl")
include("heteroscedastic.jl")
include("matern.jl")

### Return the labels in a vector of vectors for multiple outputs
function treat_labels!(y::AbstractVector{T},likelihood::L) where {T,L<:RegressionLikelihood}
    @assert T<:Real "For regression target(s) should be real valued"
    return y,1,likelihood
end