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
import android.graphics.Bitmap | |
import android.graphics.Color | |
import androidx.annotation.ColorInt | |
import com.curiouscreature.kotlin.math.Float3 | |
import com.curiouscreature.kotlin.math.Mat3 | |
import com.curiouscreature.kotlin.math.saturate | |
import com.curiouscreature.kotlin.math.transpose | |
import kotlin.math.pow | |
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
Tooling API is using target Gradle version: 1.8. | |
Tooling API is using target Gradle version: 1.8. | |
Starting Gradle daemon | |
Starting daemon process: workingDir = /home/bryan/.gradle/daemon/1.8, daemonArgs: [/opt/java/bin/java, -XX:MaxPermSize=256m, -XX:+HeapDumpOnOutOfMemoryError, , -Xmx1024m, -Dfile.encoding=UTF-8, -cp, /home/bryan/.gradle/wrapper/dists/gradle-1.8-all/2kopnp0i5dq014k75fp36m3vd5/gradle-1.8/lib/gradle-launcher-1.8.jar, org.gradle.launcher.daemon.bootstrap.GradleDaemon, 1.8, /home/bryan/.gradle/daemon, 60000, 10a4ec8d-2194-4545-902f-008c51e1ff65, -XX:MaxPermSize=256m, -XX:+HeapDumpOnOutOfMemoryError, , -Xmx1024m, -Dfile.encoding=UTF-8] | |
Starting process 'Gradle build daemon'. Working directory: /home/bryan/.gradle/daemon/1.8 Command: /opt/java/bin/java -XX:MaxPermSize=256m -XX:+HeapDumpOnOutOfMemoryError -Xmx1024m -Dfile.encoding=UTF-8 -cp /home/bryan/.gradle/wrapper/dists/gradle-1.8-all/2kopnp0i5dq014k75fp36m3vd5/gradle-1.8/lib/gradle-launcher-1.8.jar org.gradle.launcher.daemon.bootstrap.GradleDa |
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
function smim = REDUCE(im) | |
wgt = [0.0500 0.2500 0.4000 0.2500 0.0500]; | |
m = -2:2; | |
smim = zeros(ceil(size(im,1)/2), ceil(size(im,2)/2)); | |
im = padarray(im, [2 2]); | |
window = wgt'*wgt; |
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
For NFA.java: | |
public NFA copy() { | |
NFA copy = new NFA(); | |
Map<NFAState, NFAState> oldToNew = new HashMap<NFAState, NFAState>(); | |
List<NFAState> oldStates = getAllStates(); | |
//create a map linking all the old states to the new copies | |
for (NFAState oState : oldStates) { | |
NFAState nState = oState.copy(); |
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
@Test | |
public void basicPlus() { | |
NFA left = new NFA(new HashSet<Character>(Arrays.asList(new Character[]{'a', 'b', 'c'}))); | |
NFA result = NFAOperations.plus(left); | |
assert(result.accepts("a")); | |
assert(result.accepts("aa")); | |
assert(result.accepts("ab")); |