using CImGui
using CImGui.GLFWBackend
using CImGui.OpenGLBackend
using CImGui.GLFWBackend.GLFW
using CImGui.OpenGLBackend.ModernGL
using AbstractPlotting
using GLMakie
import GLMakie: make_context_current, render_frame, to_native, Screen
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using CImGui | |
using CImGui.GLFWBackend | |
using CImGui.OpenGLBackend | |
using CImGui.GLFWBackend.GLFW | |
using CImGui.OpenGLBackend.ModernGL | |
using AbstractPlotting | |
using GLMakie | |
import GLMakie: make_context_current, render_frame, to_native, Screen | |
# add ImGui rendering pass to GLMakie's rendering loop |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ReadCSV[fn_] := Module[{contents}, | |
contents = Import[fn]; | |
Dataset@ | |
With[{hdr = First[contents]}, | |
AssociationThread[hdr -> #] & /@ Rest@contents] | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Two dashes start a one-line comment. | |
--[[ | |
Adding two ['s and ]'s makes it a | |
multi-line comment. | |
--]] | |
---------------------------------------------------- | |
-- 1. Variables and flow control. | |
---------------------------------------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'torch' | |
local ffi = require("ffi") | |
function print_mat(mat) | |
for r=1,#mat do | |
row = '' | |
for c=1,#mat[r] do | |
row = row .. mat[r][c] .. '\t' | |
end | |
print(row) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'torch' | |
function calc(N, Niter) | |
u = torch.zeros(N,N) | |
u[1] = 1 | |
for i=1,Niter do | |
lua_update(u) | |
end | |
return u | |
end |