This file contains 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
fn example_uses() { | |
let retval_id = match_dwim!( | |
let Some(Inst::Ret(vals)) = msadef.last_instr(), | |
let [ref val] = vals, | |
let IRValue::Reg(id) = val, | |
id | |
).unwrap(); | |
match_dwim!( | |
let ir::Inst::TableSet{table, key, value} = inst, |
This file contains 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
# | |
# Bundle adjustment | |
# | |
using JuMP | |
using StaticArrays | |
using Rotations | |
using LinearAlgebra | |
import Ipopt |
This file contains 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
import sys | |
from collections import namedtuple | |
import numpy as np | |
Video = namedtuple('Video', 'size') | |
Endpoint = namedtuple('Endpoint', 'dc_latency conns') | |
ReqBundle = namedtuple('ReqBundle', 'video_id endpoint_id count') | |
class Problem(namedtuple('Problem', 'n_caches cache_cap videos endpoints reqs')): | |
@staticmethod |