Skip to content

Commit

Permalink
Updated to newest gradle version for the Android version
Browse files Browse the repository at this point in the history
  • Loading branch information
berndporr committed Jan 17, 2021
1 parent d014e4a commit 064742f
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 38 deletions.
Binary file added Firj/.idea/caches/gradle_models.ser
Binary file not shown.
6 changes: 6 additions & 0 deletions Firj/.idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions Firj/.idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions Firj/.idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions Firj/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Firj/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'
classpath 'com.android.tools.build:gradle:4.1.1'


// NOTE: Do not place your application dependencies here; they belong
Expand Down
2 changes: 1 addition & 1 deletion Firj/firj/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

testImplementation 'junit:junit:4.12'
testImplementation 'junit:junit:4.13.1'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@

/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class InstrumentedTest {
Expand Down Expand Up @@ -48,28 +46,4 @@ public void firTest() {
fir.release();
}

@Test
public void lmsTest() {
final int nTaps = 10;
Fir1 fir = new Fir1(nTaps);
assertEquals(nTaps,fir.getTaps());
double mu = 0.1;
fir.setLearningRate(mu);
double v = 0;
for(int i = 0;i < 10;i++) {
double e = 0;
if (i < 5) {
e = 1.0;
}
if (i > 5) {
e = -1.0;
}
fir.lmsUpdate(e);
v = fir.filter(1.0);
Log.d(TAG,"Fir1: t="+i+",v="+v);
}
assertTrue(Math.round(v) < 1E-10);
fir.release();
}

}
8 changes: 4 additions & 4 deletions Firj/firj/src/main/cpp/firwrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Java_uk_me_berndporr_firj_Fir1_getInstance(JNIEnv *env,
jdoubleArray coeffArray) {

double *coeffValues = env->GetDoubleArrayElements(coeffArray, 0);
unsigned nTaps = (unsigned) env->GetArrayLength(coeffArray);
auto nTaps = (unsigned) env->GetArrayLength(coeffArray);

Fir1 *fir = new Fir1(coeffValues, nTaps);

Expand All @@ -40,7 +40,7 @@ jint Java_uk_me_berndporr_firj_Fir1_getTaps(JNIEnv *,
jclass,
jlong instance) {
Fir1 *fir = (Fir1 *) instance;
if (fir == NULL) return 0;
if (fir == nullptr) return 0;
return (jint)(fir->getTaps());
}

Expand All @@ -51,7 +51,7 @@ Java_uk_me_berndporr_firj_Fir1_filter(JNIEnv *,
jlong instance,
jdouble value) {
Fir1 *fir = (Fir1 *) instance;
if (fir == NULL) return 0;
if (fir == nullptr) return 0;
return fir->filter(value);
}

Expand Down Expand Up @@ -89,7 +89,7 @@ void Java_uk_me_berndporr_firj_Fir1_releaseInstance(JNIEnv *,
jclass,
jlong instance) {
Fir1 *fir = (Fir1 *) instance;
if (fir == NULL) return;
if (fir == nullptr) return;
delete fir;
}

Expand Down
2 changes: 1 addition & 1 deletion Firj/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-all.zip

0 comments on commit 064742f

Please sign in to comment.